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

bsonWoCompare and bsonBinaryEqual should work with bsonelement types

    XMLWordPrintable

    Details

      Description

      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

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                3 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: