I am facing issue with CosmosDB unique key constraint. After setting up the unique key, I am able to insert duplicate documents withing same partition key. Please help me to understand if I am doing anything wrong.
Created a container with the unique key as "/name" and partition key as "/partition"
I was able to create duplicate name under same partition key using azure portal data explorer tool
Doc 1
{
"id": "1",
"partition": "p1",
"name": "Balaji",
"age": 20,
"_rid": "Y48OAI3aptUBAAAAAAAAAA==",
"_self": "dbs/Y48OAA==/colls/Y48OAI3aptU=/docs/Y48OAI3aptUBAAAAAAAAAA==/",
"_etag": "\"8e016bfd-0000-0700-0000-5e96d8a50000\"",
"_attachments": "attachments/",
"_ts": 1586944165
}
Doc 2
{
"id": "2",
"partition": "p1",
"name": "Balaji",
"age": 20,
"_rid": "Y48OAI3aptUCAAAAAAAAAA==",
"_self": "dbs/Y48OAA==/colls/Y48OAI3aptU=/docs/Y48OAI3aptUCAAAAAAAAAA==/",
"_etag": "\"8f017400-0000-0700-0000-5e96d8d60000\"",
"_attachments": "attachments/",
"_ts": 1586944214
}
Advance Thanks !!