[SERVER-80458] $count aggregation stage does return nothing when count is zero Created: 28/Aug/23 Updated: 15/Sep/23 |
|
| Status: | Backlog |
| Project: | Core Server |
| Component/s: | Aggregation Framework |
| Affects Version/s: | 6.0.9 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Daniel Müller | Assignee: | Backlog - Query Optimization |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Assigned Teams: |
Query Optimization
|
||||||||
| Operating System: | ALL | ||||||||
| Steps To Reproduce: | 1: Create a new empty collection 2: Run the sample aggregation
3: Notice that it does not return anything. Expected result:
4: Add an object to the collection 5: Run the aggregation again 6: Returns an expected result of:
|
||||||||
| Participants: | |||||||||
| Description |
|
I was using the aggregation stage $count and noticed that if the input dataset was empty that $count does not return anything. I was expecting it to return 0. There is nothing specified in the docs to expect this behaviour. |