How can we improve Azure Cosmos DB?

Fix sort results when documents are missing sort field

When documents are missing the sort field, they should still be included in the query results. Cosmos DB with MongoDB API omits these documents, but MongoDB includes them.

For example, the following query will return people sorted by age, but documents missing the age field do not appear in the results:

peopleCollection.find().sort({ age: 1 })

This is probably related to the following Cosmos DB with SQL API issue: https://feedback.azure.com/forums/263030-azure-cosmos-db/suggestions/16842499-order-by-null-handling. Will resolving that issue fix MongoDB sorting as well?

4 votes
Vote
Sign in
(thinking…)
Sign in with: oidc
Signed in as (Sign out)
You have left! (?) (thinking…)
Ryan shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

0 comments

Sign in
(thinking…)
Sign in with: oidc
Signed in as (Sign out)
Submitting...

Feedback and Knowledge Base