[SERVER-54235] Implement $count window function desugaring Created: 03/Feb/21 Updated: 29/Oct/23 Resolved: 30/Apr/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 5.0.0-rc0 |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Nicholas Zolnierz | Assignee: | Joel Redman (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Sprint: | Query Optimization 2021-02-22, Query Optimization 2021-03-08, Query Optimization 2021-03-22, Query Optimization 2021-04-05, Query Optimization 2021-04-19, Query Optimization 2021-05-03 | ||||||||
| Participants: | |||||||||
| Description |
|
From Syntax: $count This is a new accumulator which returns the number of documents in the current window/partition. In $group, it is identical to {newField: {$sum: 1}} but will only be exposed as a window function. It is an error to specify an input expression to $count, but a non-default window may be specified. {newField: {$count: {}, window: ...}}
From Technical Design Document: A $count window function will be desugared to a $sum with an input expression of the constant '1'. The window definition will remain the same. |
| Comments |
| Comment by Githook User [ 30/Apr/21 ] |
|
Author: {'name': 'Joel Redman', 'email': 'joel.redman@mongodb.com', 'username': 'joredman'}Message: |