It looks like Compass does not preserve the order of sort keys.
This manifests the same JavaScript problem as SERVER-11358 / NODE-578 when numeric-like keys are used.
For example, a sort order of:
{'65534':1, '65533':1}ends up as:
{'65533':1, '65534':1}An order-preserving data structure should be used.
- is related to
-
NODE-578 Order of sort fields is lost for numeric field names
- Closed
-
NODE-3173 sort behaves differently when passed as an option or called as a method on cursor
- Closed
-
MONGOSH-1037 Numeric field are sorted to the front (js shell)
- Closed
- related to
-
COMPASS-4644 Support new 4.4 find project syntax
- Closed