Uploaded image for project: 'MongoDB Shell'
  1. MongoDB Shell
  2. MONGOSH-1854

Not able to sort on multiple nested fields in Atlas Search query

    • Type: Icon: Bug Bug
    • Resolution: Incomplete
    • Priority: Icon: Major - P3 Major - P3
    • No version
    • Affects Version/s: None
    • Component/s: None
    • None
    • Environment:
      OS:
      node.js / npm versions:
      Additional info:
    • Developer Tools
    • Not Needed

      Problem Statement/Rationale

      Not able to sort on multiple nested fields in Atlas Search query.

       

      [{"_id":{"$oid":"1"},"properties":{"Name":"ATest","Age":30}},
      {"_id":{"$oid":"2"},"properties":{"Name":"BTest","Age":32}},
      {"_id":{"$oid":"3"},"properties":{"Name":"CTest","Age":34}},
      {"_id":{"$oid":"4"},"properties":{"Name":"DTest","Age":32}}]

       

      Atlas Search Query :

       

       

      [
        {
          $search: {
            index: "default",
            text: {
              query: "some text",
              path: {
                wildcard: "*"
              }
            },
            sort: {
              "properties.Age": -1,
              "properties.Name": 1
            }
          }
        }
      ]
      

       

       

      Please be sure to attach relevant logs with any sensitive data redacted.
      How to retrieve logs for: Compass; Shell

      Steps to Reproduce

      How could an engineer replicate the issue you're reporting?

      Expected Results

      What do you expect to happen?

      Actual Results

      What do you observe is happening?

      Additional Notes

      Any additional information that may be useful to include.

            Assignee:
            Unassigned Unassigned
            Reporter:
            vipulpachauri12@gmail.com vipul pachauri
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: