Document and BasicDBObject toJson methods move the _id field to the first key

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 3.11.0
    • Affects Version/s: None
    • Component/s: JSON
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      They both do this by calling EncoderContext.isEncodingCollectibleDocument(true).

      BsonDocument#toJson, inconsistently, does not do any re-ordering.

      I think the current behavior is wrong, as there are situations where this reordering is incorrect, e.g. for MongoDB index specifications.

            Assignee:
            John Stewart (Inactive)
            Reporter:
            Jeffrey Yemin
            None
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: