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

add $sort and $size to the projection operators

    • Type: Icon: New Feature New Feature
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Fully Compatible

      Working with embedded array has improved so much with introduction of $[] and $[<identifier>] in v3.6, but still there is no easy way to sort the embedded documents or get their count. Adding these two operator to the projection would eliminate need of using aggregation framework for usual tasks:

      db.collection.find( { field: value }, { array: {$slice: count, $sort: field, $size: newField} } );

            Assignee:
            asya.kamsky@mongodb.com Asya Kamsky
            Reporter:
            rahbari@gmail.com Ali Rahbari
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: