Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-30773

bsonWoCompare and bsonBinaryEqual should work with bsonelement types

    • Fully Compatible
    • v4.0
    • Service Arch 2018-10-08
    • 42

      bsonWoCompare and bsonBinaryEqual check to see if their arguments are objects (which they are for our exposed bson types), before converting them to bson and then dispatching to underlying bson methods.

      This inappropriately shows any special two non-top-level bson values as equal (without throwing) as they convert as general objects (with no actual fields). For some objects, like timestamp, this works (as they store their state as js visible fields). For others, like numberlong or bindata, it does not.

      It appears that we have instances of both patterns in current jstests, so it may be advantageous to check for the bson element types, and wrap the objects in that case.

      If we don't want to make them work correctly, we should at least throw for broken types

            Assignee:
            annie.black@mongodb.com Annie Black
            Reporter:
            mira.carey@mongodb.com Mira Carey
            Votes:
            3 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: