Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-9590

Update $push + $sort should be able to sort by the whole array element

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 2.5.3
    • Affects Version/s: None
    • Component/s: Write Ops
    • Labels:

      I am suggesting a way to sort by the elements not just some part of them ({$sort:{"field":order}}).

      One possible syntax would be:

      {$push:{$each:[...], $sort:-1}}// sort whole element, desc.

            Assignee:
            scotthernandez Scott Hernandez (Inactive)
            Reporter:
            scotthernandez Scott Hernandez (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: