Unique constraint on document properties
While document ID's are unique, I would like a unique constraint on a given property as well. Today, the only ways I see to accomplish this is either with a client-side query or a pre-trigger (also requiring a query).
I'd like a "unique" constraint to be applicable for given property names within a collection.
Please check details here https://docs.microsoft.com/en-us/azure/cosmos-db/unique-keys?view=azure-dotnet
Will this be available for graphs as well? Please also add filtered unique index option. This is useful in cases where a row is soft deleted and does not participate in the original unique constraint.
Jonas Hansen commented
Awesome! Will this be scoped by partitions or collections or configurable?
Thanks for the input. This is under discussion stage at present.
Urmi Nexus commented
Currently it's not possible to create a unique/standard key index on attribute. Please add apart for it. Quite a lot of logic designs depends on finding and stopping duplicate keys now without the support of inherent indexes.