Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-13234

explain that group by multiple fields is supported for $group

      Description

      I think you should add an example that groups on multiple fields in 
      https://docs.mongodb.com/manual/reference/operator/aggregation/group/

      I ended up learning about this elsewhere, but the quality of those web pages was much lower than the quality of MongoDB docs, so I prefer to remain within the docs.

      I wanted to do something like:

       

      db.sales.aggregate( [ { $group: { _id: { v1,: "field1", v2: "field2" },
                              count: { $sum: 1 } } } ] )

       

       

      Scope of changes

      Impact to Other Docs

      MVP (Work and Date)

      Resources (Scope or Design Docs, Invision, etc.)

            Assignee:
            Unassigned Unassigned
            Reporter:
            mdcallag@gmail.com Mark Callaghan
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              1 year, 25 weeks, 2 days ago