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

bsonWoCompare and bsonBinaryEqual should work with bsonelement types

    XMLWordPrintable

    Details

    • Backwards Compatibility:
      Fully Compatible
    • Backport Requested:
      v4.0
    • Sprint:
      Service Arch 2018-10-08
    • Linked BF Score:
      42

      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

              Assignee:
              annie.black Annie Black
              Reporter:
              jason.carey Jason Carey
              Participants:
              Votes:
              3 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: