I use Azure CosmosDb with MongoDb Api and got collection of documents with a structure bellow. I have to filter documents by parameter, ex.
x => x.Parameters.Any(xx => xx.Key == ParameterNames.ShiftId && (int)xx.Value == shiftId)
It seems to me to better performance I need to create index, but I cannot find any information how can I do it.
{
"_id": "08d8c696-2b7b-f227-d5dd-0647a8d51c1c",
"State": 2,
"Created": {
"$date": "2021-02-01T09:45:54.986Z"
},
"TailId": "e8fb236e-4d48-417b-bf5a-73f1d48fe239",
"Parameters": [{
"k": "ShiftId",
"v": 181
}, {
"k": "Id",
"v": "147814878155"
}, ....
]
}