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

Reintroduce validation for no $-prefixed fields in _id

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 5.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Fully Compatible
    • ALL
    • 151

      As part of SERVER-49117, validation for the _id field ensuring that it is not possible to insert a document with an _id field that is an object containing $-prefixed fields was removed. This code (https://github.com/mongodb/mongo/blob/master/src/mongo/db/repl/oplog.cpp#L1360-L1366) to update the oplog calls an update on the _id field along a path that still validates that _id, which caused BF-21074. The simple solution is to add the _id validation back here: https://github.com/mongodb/mongo/commit/995f0406d72b1a15d18b2df2d8c0afa0c4c5b774#diff-5295b5000db7b3711a31f86ebbe374e929270da88b36b20d3459c9b1d4f48d17R135-R136

            Assignee:
            alya.berciu@mongodb.com Alya Berciu
            Reporter:
            alya.berciu@mongodb.com Alya Berciu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: