[DOCS-4785] add $cond example to the $group stage documentation (aggregation) Created: 06/Feb/15 Updated: 07/Apr/23 Resolved: 03/Mar/15 |
|
| Status: | Closed |
| Project: | Documentation |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 01112017-cleanup |
| Type: | Improvement | Priority: | Trivial - P5 |
| Reporter: | Evan Altman | Assignee: | Unassigned |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Participants: | |
| Days since reply: | 9 years, 1 week, 6 days ago |
| Description |
|
I was recently trying to determine whether or not I could calculate a sum during an aggregation $group stage, based on certain conditions. However, neither the $group, nor the $cond documentation (or $sum, for that matter) make any reference to the fact that this is possible. I think it may be helpful to include an example, or at least to reference that this is in fact possible. |