Overview of Constraints
Learn how to create unique key policies on a Cosmos DB container to improve consistency.
We'll cover the following...
Constraints
We read that JSON documents are flexible multiple times and that applications must maintain consistency. However, there is something we can do at the container level—we can add unique key constraints. We can tell Cosmos DB that a value for a specific path, or a combination of multiple ones, is unique.
For example:
On a
userscontainer, we can set/emailas unique.On a
gamescontainer, we can set the combination of/titleand/yearas unique.
Note: These limitations are applied only within a ...
Ask