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

applyOps does not validate updates

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Backlog
    • Major - P3
    • Resolution: Unresolved
    • 3.4.10, 3.6.2, 3.7.1
    • None
    • 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

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated: