Details
-
Bug
-
Resolution: Fixed
-
Major - P3
-
None
-
None
-
Query Integration
-
Fully Compatible
-
ALL
-
18
Description
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.
Attachments
Issue Links
- is depended on by
-
SERVER-85096 TRACKING: M3 Correctness Tickets
-
- Closed
-