I have created a new collection in CosmosDB and I'm trying to create my first index.
I run the following script:
db.getCollection("mycoll").createIndex({ "UniqueId": 1 }, { "name": "udx_mycoll_UniqueId", "unique": true });
And it produces the response:
{
"_t" : "CreateIndexesResponse",
"ok" : 1,
"createdCollectionAutomatically" : false,
"numIndexesBefore" : 3,
"numIndexesAfter" : 4
}
Which looks promising, but when I run the query:
db.mycoll.getIndexes();
No indexes are found. I tried running it in Compass too, and I get an error when I switch to the indexes tab:
'$indexState' is not supported
Anyone able to shed some light on this?