I am investigating using CosmosDB (previously DocumentDB), we currently use MongoDB so I am trying to use the MongoAPI for CosmosDB.
I have created a CosmosDB deployment in azure, created a collection and specified a partition key of "/rateId".
As far as I can understand from Microsofts documentation this partition key should relate to a property in each document I insert, so I am trying to insert a basic document like so:
{
"rateId": "test.1",
"val": "test2"
}
However when I try to insert this (through Mongo C# driver or through MongoChef) I get an error "document does not contain shard key".
I have tried this every which way I can think of and every time I am denied with this error. Am I misunderstanding how this is meant to work, or doing something wrong?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…