azure-cosmosdbazure-cosmosdb-mongoapi

CosmosDB create compound unique index error


I wanted to create a compound unique index using 2 fields, but one of those has a path to some inner field like evaluated.rut. But I got an error:

enter image description here

I don't get the error, in MongoDB I had created index like that, but I can't now in CosmosDB, any suggestion?


Solution

  • Provided the nested path is not an array, the support for this is coming out very soon using the value EnableUniqueCompoundNestedDocs in the capabilities property array for a Cosmos DB databaseAccounts resource in ARM.

    This is not yet publicly available. If you'd like to try today you can open a support ticket and ask this capability be added your Cosmos account. You can also DM me on Twitter (see my SO profile) and send me your Cosmos account name and I can request it for you.