[COMPASS-4258] Sort does not preserve field order Created: 22/Apr/20  Updated: 29/Oct/23  Resolved: 09/Apr/21

Status: Closed
Project: Compass
Component/s: Query Bar
Affects Version/s: 1.20.5
Fix Version/s: 1.27

Type: Bug Priority: Major - P3
Reporter: Stennie Steneker (Inactive) Assignee: Sergey Petushkov
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Compass 1.20.5


Attachments: PNG File compass-sort.png    
Issue Links:
Related
related to COMPASS-4644 Support new 4.4 find project syntax Closed
is related to NODE-578 Order of sort fields is lost for nume... Closed
is related to NODE-3173 sort behaves differently when passed ... Closed
is related to MONGOSH-1037 Numeric field are sorted to the front... Closed
Story Points: 3
Documentation Changes: Not Needed
Sprint: Iteration Yucca, Iteration Z

 Description   

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.



 Comments   
Comment by Githook User [ 09/Apr/21 ]

Author:

{'name': 'Sergey', 'email': 'petushkov.sergey@gmail.com', 'username': 'gribnoysup'}

Message: fix(crud, query-bar): Allow new project syntax and arrays in sort in query bar COMPASS-4644 COMPASS-4258 (#2156)
Branch: master
https://github.com/mongodb-js/compass/commit/0bd73bae151a1d13da61462c585a853f50caa8bf

Generated at Wed Feb 07 22:35:45 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.