-
Type:
Bug
-
Resolution: Works as Designed
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Execution
-
ALL
-
-
None
-
3
-
None
-
None
-
None
-
None
-
None
-
None
Found an issue with how a $match stage works with a function as part of the query. It occurs when performing a search within an array. There is an attached sample data file and a sample JS file for execution. The first and third aggregations work as expected; however the second fails.
It is assumed that comparing elements in an array against a literal (ie 2) should return the same as comparing elements in an array against a MULTIPLE(2, 1) function.
This pattern has been reduced down to the simplest form versus how we discovered this. Our use case was matching into an array of objects post a $lookup stage to find root records that match a condition of documents in the $lookup array.
This was also proven to work against an array when $group was used.
It seems to not be tied to integers, numerics, dates, either. Simple the use of a function in the match seems to be the issue.
The JS file is commented with notes and assumptions about expected behavior.
Thank you
- related to
-
SERVER-101190 Support comparison expressions against arrays in $lookup
-
- Needs Scheduling
-