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

XMLWordPrintableJSON

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

      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 Stearn
            Reporter:
            Clifford Hammerschmidt
            Votes:
            5 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: