-
Is it possible to make a group of fields unique in a model, kinda like how Prisma has the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
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. |
Beta Was this translation helpful? Give feedback.
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.