[DOCS-14025] Comparison/Sort Order documentation for objects is incorrect Created: 01/Dec/20  Updated: 30/Oct/23  Resolved: 02/Dec/20

Status: Closed
Project: Documentation
Component/s: manual, Server
Affects Version/s: None
Fix Version/s: Server_Docs_20231030

Type: Bug Priority: Major - P3
Reporter: Geert Bosch Assignee: Jeffrey Allen
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-51258 Unexpected behavior in range query on... Closed
Problem/Incident
causes SERVER-51258 Unexpected behavior in range query on... Closed
Participants:
Days since reply: 3 years, 2 weeks, 2 days ago
Epic Link: DOCSP-11701
Story Points: 2

 Description   

Description

In https://docs.mongodb.com/manual/reference/bson-type-comparison-order/index.html#objects, object order is defined as:

  1. Recursively compare key-value pairs in the order that they appear within the BSON object.
  2. Compare the key field names.
  3. If the key field names are equal, compare the field values.
  4. If the field values are equal, compare the next key/value pair (return to step 1). An object without further pairs is less than an object with further pairs.

However, before 2. is an extra step that compares the field types.

Scope of changes

Impact to Other Docs

MVP (Work and Date)

Resources (Scope or Design Docs, Invision, etc.)



 Comments   
Comment by Githook User [ 25/Jan/21 ]

Author:

{'name': 'Jeff Allen', 'email': 'jeffrey.allen@mongodb.com'}

Message: (DOCS-14025): Fix sort order for objects
Branch: v4.2.12
https://github.com/mongodb/docs/commit/30ba33154abb249e7701d68181474e0128b2d596

Comment by Githook User [ 02/Dec/20 ]

Author:

{'name': 'Jeff Allen', 'email': 'jeffrey.allen@mongodb.com'}

Message: (DOCS-14025): Fix sort order for objects
Branch: v4.0
https://github.com/mongodb/docs/commit/a4a09bcde1535f79bfa45dd9121b789771e4e5d1

Comment by Githook User [ 02/Dec/20 ]

Author:

{'name': 'Jeff Allen', 'email': 'jeffrey.allen@mongodb.com'}

Message: (DOCS-14025): Fix sort order for objects
Branch: v4.2
https://github.com/mongodb/docs/commit/30ba33154abb249e7701d68181474e0128b2d596

Comment by Githook User [ 02/Dec/20 ]

Author:

{'name': 'Jeff Allen', 'email': 'jeffrey.allen@mongodb.com'}

Message: (DOCS-14025): Fix sort order for objects
Branch: v5.0
https://github.com/mongodb/docs/commit/3af6a93b44cd272f500f515e9f0b16561fd1feb9

Comment by Githook User [ 02/Dec/20 ]

Author:

{'name': 'Jeff Allen', 'email': 'jeffrey.allen@mongodb.com'}

Message: (DOCS-14025): Fix sort order for objects
Branch: master
https://github.com/mongodb/docs/commit/36318b740514765158a5a6f12ba2e7b1f3d109ae

Generated at Thu Feb 08 08:09:19 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.