-
Type: Bug
-
Resolution: Done
-
Priority: Critical - P2
-
Affects Version/s: None
-
Component/s: Aggregation Framework, Querying
-
None
-
Fully Compatible
-
Query 18 (08/05/16), Query 2016-08-29, Query 2016-09-19, Query 2016-10-10
-
0
The difficulty is that parsing of the aggregation pipeline is done before lock acquisition, but the final collation is not always known until after the collection lock has been acquired (since we may need to read the collection's metadata describing the collection default collation). max.hirschhorn and myself brainstormed a few potential solutions:
- Parse the aggregation pipeline under the lock so we know what the collation is.
- Remove the comparisons and let users create buckets that will always be empty.
- Configure the $group stage to do the checks that require collation by making it aware that it's a $group for bucketing.
- Create a DocumentSourceBucket class that during its optimize() method does these checks, adds a DocumentSourceGroup and DocumentSourceSort to the pipeline, and then removes itself from the pipeline.