-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: 6.0.5
-
Component/s: None
-
Environment:OS: Windows 10
node.js / npm versions: latest stable
Additional info:
-
Server Triage
-
ALL
Problem Statement/Rationale
When updating an existing document in Atlas, the fields are reordered in alphabetical order by key, rather than maintaining the order they were entered in upon applying the update.
Please be sure to attach relevant logs with any sensitive data redacted.
How to retrieve logs for: Compass; Shell
Steps to Reproduce
- Insert a new document in a collection in Atlas containing only the auto-generated ObjectID field/value pair
- Edit the document you just created, adding one field with a key that starts with "Z" and a second field with a key that starts with "A"
- Click Update.
Expected Results
The fields should retain the order from the update interface. The Z field should come first, and the A field should come second.
Actual Results
The keys and values are both saved, but they're reordered so the A key is first, and the Z key is second
Additional Notes
This appears to be related/similar to SERVER-2592. I've also seen the same behavior in Compass, but I don't have screenshots from Compass currently. I'm using a M0 Sandbox (General) tier cluster.
- is related to
-
SERVER-2592 The fields in a document are reordered (sorted alphabetically) when setting a field value
- Closed
-
SERVER-74408 Insert document exactly as specified on upserts
- Closed