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

applyOps does not validate updates

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.4.10, 3.6.2, 3.7.1
    • Component/s: Replication, Write Ops
    • Replication
    • ALL
    • Hide
      > db.c.insert({_id: 1})
      WriteResult({ "nInserted" : 1 })
      > db.adminCommand({applyOps: [{op: 'u', ns: 'test.c', o: {_id: 1, $bad: 1}, o2: {_id: 1}}]})
      { "applied" : 1, "results" : [ true ], "ok" : 1 }
      > db.c.find()
      { "_id" : 1, "$bad" : 1 }
      
      Show
      > db.c.insert({_id: 1}) WriteResult({ "nInserted" : 1 }) > db.adminCommand({applyOps: [{op: 'u' , ns: 'test.c' , o: {_id: 1, $bad: 1}, o2: {_id: 1}}]}) { "applied" : 1, "results" : [ true ], "ok" : 1 } > db.c.find() { "_id" : 1, "$bad" : 1 }
    • 18

      The update command will validate updates for modified immutable fields, $-prefixed fields, BSON depth, etc. When updates are performed through applyOps, this validation is not performed.

            Assignee:
            backlog-server-repl [DO NOT USE] Backlog - Replication Team
            Reporter:
            tess.avitabile@mongodb.com Tess Avitabile (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated: