-
Type: Bug
-
Resolution: Works as Designed
-
Priority: Major - P3
-
None
-
Affects Version/s: 3.6.8, 4.0.4
-
Component/s: Index Maintenance, Querying, WiredTiger
-
None
-
ALL
-
I have a system which stores documents that have an array valued field which contains pairs of metric names and values. I also have a compound index on this field which should enable querying for all documents containing a metric with a given name and returning them sorted by metric value. However, it looks like sorting works correctly only of the first element of the array.
I'm pretty sure it did work as expected in previous MongoDB versions, but I'm not sure when it stopped working.
I did work around the issue using the aggregation framework to get the correct sorting, but this has slowed down queries a lot.