[SERVER-37276] Allow constant integer in $group clause Created: 23/Sep/18 Updated: 06/Dec/22 |
|
| Status: | Backlog |
| Project: | Core Server |
| Component/s: | Aggregation Framework |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | Renato Riccio | Assignee: | Backlog - Query Optimization |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | mql-semantics | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Assigned Teams: |
Query Optimization
|
| Participants: |
| Description |
|
Currently, $group does not allow to have a constant integer in a group clause, on the other hand, it supports strings. For example
If set d as a string we don't get any error
In order to be consistent group should support also integer inside _id |
| Comments |
| Comment by Renato Riccio [ 24/Sep/18 ] | |
|
I confirm $literal it works as workaround:
| |
| Comment by Asya Kamsky [ 24/Sep/18 ] | |
|
You can use $literal. But it’s a bit silly - we fixed it somewhere else I’m pretty sure. | |
| Comment by Andy Schwerin [ 24/Sep/18 ] | |
|
Can you use {$literal:1}? |