add $sort and $size to the projection operators

XMLWordPrintableJSON

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

      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
            Reporter:
            Ali Rahbari
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: