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

add $sort and $size to the projection operators

    XMLWordPrintableJSON

Details

    • Icon: New Feature New Feature
    • Resolution: Won't Fix
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • None
    • Fully Compatible

    Description

      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} } );

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: