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

okForStorage should be stricter when checking for DBRefs

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Internal Code
    • Labels:
      None
    • Fully Compatible
    • ALL

      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.

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

              Created:
              Updated:
              Resolved: