-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
Query Integration
-
Fully Compatible
-
ALL
-
18
We noticed some interesting behavior for query shapes with variadic expressions (e.g. $multiply, $sum, etc). Here are some contrasting examples:
db.c.aggregate([{$group: {_id: {$multiply: [1, 2, {$const: 3}]}}}])
is simplified to
{"$group": {"_id": {"$multiply": "?array<?number>"}}}
while
db.c.aggregate([{$group: {_id: {$multiply: [1, {$const: 1}, {$expr: {$sum: [1]}}]}}}])
is generally preserved as
{"$group": {"_id": {"$multiply": ["?number", "?number", "$myField", {"$sum": "?array<?number>"}]}}}
It's not clear what the desirable behavior here (there's a tradeoff between a possibly high cardinality of query shapes vs losing details of the user's original query), but it seems like the behavior between these two cases should not be so different.
- is depended on by
-
SERVER-85096 TRACKING: M3 Correctness Tickets
- Closed
- related to
-
SERVER-88296 $group constant expression fails to re-parse
- Closed