Azure Cosmos DB Sorting Issue using Mongo API

  1. I am using azure cosos db using mongo API. I have created a document structure below.
  "candidate_id": 202,
  "name": "Chandan Testc",
  "email": "",
  "category": "Daily",
  "zipcode": "41150",
  "candidate_sub_organizations": [
      "sub_organization_id": 539,
      "twoway_text_subs": true,
      "is_blocked": false
  1. I have already created an index for all necessary fields and specific twoway_text_subs field.
  2. when I try to sort by twoway_text_subs it not working properly. It changes the order of sorting but returns correct sorting.
  3. sorting {‘candidate_sub_organizations.twoway_text_subs’:-1} : it not return proper filtering data.

This is a support forum for MongoDB, not Azure Cosmos DB. The Cosmos MongoDB API is an emulator that is not fully compatible with, or supported by MongoDB.

1 Like