- In JSON key order doesn't matter for comparison, in BSON it does (e.g. in JSON
{'a': 1, 'b': 2}
==
{'b': 2, 'a': 1}
, in BSON
{'a': 1, 'b': 2}
!=
{'b': 2, 'a': 1}
)
- BSON is ordered but driver representations may not be
- The server itself does not guarantee order (e.g updating a document may change the order of its fields)
- The implications of 1, 2, and 3 for unique indexes and other MongoDB operations (e.g. commands where the command name must be the first field, geospatial queries and point format, etc.).
|