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

okForStorage should be stricter when checking for DBRefs

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor - P4 Minor - P4
    • None
    • None
    • Internal Code
    • None
    • Fully Compatible
    • ALL

    Description

      DBRefs are okForStorage in jsobj.cpp:891, but the code only checks for existence of $ref or $id. It should be stricter, checking for both $ref and $id.

      Currently, these return true for okForStorage:

      • {$id: 1}
      • {$ref: 1}

      But should probably return false as they are not valid documents.

      This is used in many places to verify valid fields, including DBRefs.

      Attachments

        Activity

          People

            Unassigned Unassigned
            thomas.rueckstiess@mongodb.com Thomas Rueckstiess
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: