Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-3888

BsonDocument.equals should consider field order

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • None
    • None
    • BSON
    • None

    Description

      When comparing two BsonDocuments using the BsonDocuments.equals() method the order of the fields does not seem to be considered.

      Currently {a:1, b:1}.equals({b:1,a:1})  evaluates to true for BsonDocuments. For documents the expected behavior would be that documents are only considered to be same if the field order is the same. 

      Attachments

        Activity

          People

            Unassigned Unassigned
            kai.orend@mongodb.com Kai Orend
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated: