Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-1411

Clarifications on BSON field ordering

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      1. 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}

        )

      2. BSON is ordered but driver representations may not be
      3. The server itself does not guarantee order (e.g updating a document may change the order of its fields)
      4. 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.).

            Assignee:
            Unassigned Unassigned
            Reporter:
            stephen.lee Stephen Lee
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:
              10 years, 35 weeks ago