[SERVER-59951] Make object form of the '_id' group-by expression work to handle multiple group-by keys. Created: 14/Sep/21 Updated: 29/Oct/23 Resolved: 19/Jan/22 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 5.3.0 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Yoon Soo Kim | Assignee: | Yoon Soo Kim |
| 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: | QE 2021-11-15, QE 2021-11-29, QE 2021-12-13, QE 2021-12-27, QE 2022-01-10, QE 2022-01-24 | ||||||||
| Participants: | |||||||||
| Description |
|
Currently $group SBE stage builder (SlotBasedStageBuilder::buildGroup) does not support object form of the '_id' group-by expression like _id: {a: "$a", b: "$b"}. Two ideas were proposed so far. 1) One idea is to pass through ExpressionObject from DocumentSourceGroup to GroupNode QSN to SlotBasedStageBuilder::buildGroup and implement the expression walker for ExpressionObject.
2) Another idea is to insert a mkbson stage manually to compose a _id document out of multiple group-by key expressions before returning a result document.
Maybe we can follow a hybrid approach to get the best out of two approaches above though code changes would be bigger. 1. Pass through ExpressionObject from DocumentSourceGroup to GroupNode QSN to SlotBasedStageBuilder::buildGroup and implement the expression walker for ExpressionObject. Pros:
Cons:
|
| Comments |
| Comment by Githook User [ 19/Jan/22 ] |
|
Author: {'name': 'Yoonsoo Kim', 'email': 'yoonsoo.kim@mongodb.com', 'username': 'yun-soo'}Message: |