Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-12064

Please specify whether $sort in $push is stable

    XMLWordPrintableJSON

Details

    Description

      Description

      I was reading this page:

      https://docs.mongodb.com/manual/reference/operator/update/sort/

      and wanted to know if $sort was stable or not. Unfortunately for me, this information is not on the page. Specifically, I wanted to see either:

      "$sort executes a stable sort; if two items in the array are being sorted on the same field, and they have the same value for that field, the earlier item will still be earlier after the sort is done."

      Or:

      "$sort is not guaranteed to be stable. If two items in the array are being sorted on a field, and they have the same value for that field, their relative positions in the array might be different after the sort is complete."

       

      Please include this information in the documentation! Unfortunately I still don't know the answer to the question, so you'll have to investigate whether $sort is supposed to be stable or not.

      Scope of changes

      Impact to Other Docs

      MVP (Work and Date)

      Resources (Scope or Design Docs, Invision, etc.)

      Attachments

        Activity

          People

            Unassigned Unassigned
            nrook-spoke Nate Rook
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              1 year, 14 weeks, 2 days ago