[DOCS-13234] explain that group by multiple fields is supported for $group Created: 20/Nov/19  Updated: 30/Oct/23

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: None
Fix Version/s: Server_Docs_20231030

Type: Improvement Priority: Minor - P4
Reporter: Mark Callaghan Assignee: Unassigned
Resolution: Won't Do Votes: 1
Labels: docs-aggregation
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:
Days since reply: 1 year, 14 weeks, 2 days ago
Epic Link: DOCSP-1769

 Description   

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.)



 Comments   
Comment by Education Bot [ 31/Oct/22 ]

Hello! This ticket has been closed due to inactivity. If you believe this ticket is still important, please reopen it and leave a comment to explain why. Thank you!

Comment by pranav menon [ 08/Nov/20 ]

I agree, I learnt that this was possible from this issue .

It would be nice if we could add this to the official docs.

Generated at Thu Feb 08 08:07:15 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.