MongoDB array sort not working in CosmoDB

UPDATE

The CosmoDB team has confirmed that there is a problem in their statement, and they are already working on a fix.

Additional information in the comments section here: https://docs.microsoft.com/en-us/azure/cosmos-db/mongodb-introduction

ORIGINAL QUESTION

we plan to switch to CosmoDB, but we found a problem with the $ sort command. On our current MongoDB server, this request is executed:

db.getCollection('Product').find({ 
"ProductTypeId" : ObjectId("5913546b1ba88338e4347641"), 
"SubtypeIngredients" : "5949852c1ba88344d0facbf5"
})
.skip(0).sort({ "IngredientRanks.2.Rank" : 1 }).limit(1)

We get some results, but when we run the same query in CosmoDB, we get no results.

if I remove the sort command from the query, I get results from CosmoDB

The data in the collection is the same in our local db and CosmoDB.

Any help would be greatly appreciated. Thank!

Update:

Here is a screenshot of the actual request showing the problem.

enter image description here

+4
1

, CosmoDB MongoDB, API (, sort, skip ..). .

0

Source: https://habr.com/ru/post/1688953/


All Articles