Skip to content

Unique fields in model? #212

Answered by edobrb
Atlinx asked this question in Q&A
May 26, 2022 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

This feature is not available yet. How would you achieve this with a middleware? The only way I can think of is to check in the before insert if the record is already present, and to disable the update of the aforesaid fields, perhaps all fo this in transaction.

I think the best way to achieve this is to create the related indexes for MongoDB and related constraint for SQL.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@minox86
Comment options

@Atlinx
Comment options

Answer selected by Atlinx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants