Uploaded image for project: 'Drivers'
  1. Drivers
  2. DRIVERS-133

Drivers should not allow sending _ids with a key starting with $

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Component/s: None
    • Labels:
      None
    • $i18n.getText("admin.common.words.hide")
      Key Status/Resolution FixVersion
      CXX-518 Done legacy-1.0.1
      PERL-547 Won't Fix
      $i18n.getText("admin.common.words.show")
      #scriptField, #scriptField *{ border: 1px solid black; } #scriptField{ border-collapse: collapse; } #scriptField td { text-align: center; /* Center-align text in table cells */ } #scriptField td.key { text-align: left; /* Left-align text in the Key column */ } #scriptField a { text-decoration: none; /* Remove underlines from links */ border: none; /* Remove border from links */ } /* Add green background color to cells with FixVersion */ #scriptField td.hasFixVersion { background-color: #00FF00; /* Green color code */ } /* Center-align the first row headers */ #scriptField th { text-align: center; } Key Status/Resolution FixVersion CXX-518 Done legacy-1.0.1 PERL-547 Won't Fix

      Raised this in as PYTHON-623 first, but after discussion with jesse this should probably be a more general discussion amongst all drivers.

      See also related SERVER-12209 ticket where this issue came up.

      Sending a document with _id of extended JSON form to a primary will succeed but crash all secondaries immediately upon replication.

      {'_id': {'$oid': "52d0b971b3ba219fdeb4170e" } }
      

      Some drivers seem to validate for such cases (key starts with $ in nested sub-document) and reject the write, while others (I only tested with Python so far) don't. The behavior should be consistent.

      Another discussion point is whether these validations should happen on the driver or server side. Currently --objcheck seems not to protect the server from such _ids.

            Assignee:
            barrie Barrie Segal
            Reporter:
            thomas.rueckstiess@mongodb.com Thomas Rueckstiess
            Votes:
            0 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated:
              Resolved: