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

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

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 2.5.3
    • Affects Version/s: 2.1.1
    • Component/s: Aggregation Framework
    • None
    • Fully Compatible

      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.

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

              Created:
              Updated:
              Resolved: