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

In $group allow "$$ROOT" to expand to the whole document matched.

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • 2.5.3
    • 2.1.1
    • Aggregation Framework
    • None
    • Fully Compatible

    Description

      Allow:
      db.coll.aggregate({$group:{_id:"$field", docs:{$push:"$$ROOT"}}});

      Currently {$push:"$field"} is supported, which accumulates a field from the document. Adding support for "$$ROOT" to expand to the full document would seem to make sense then.

      Attachments

        Activity

          People

            mathias@mongodb.com Mathias Stearn
            tanglebones Clifford Hammerschmidt
            Votes:
            5 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: