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

bypassDocumentValidation no longer accepts numeric types

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 3.3.6
    • None
    • Write Ops
    • None
    • Fully Compatible
    • ALL
    • Hide

      Build a recent mongod from the master branch (e.g. 5f7c803e8dba959e5da4135b76a1d1e05d75636d), run it and connect via mongo:

      > db.runCommand({insert:"foo", documents:[ {x:1} ], bypassDocumentValidation: 1})
      {
              "ok" : 0,
              "errmsg" : "Wrong type for 'bypassDocumentValidation'. Expected a bool, got a double.",
              "code" : 14
      }
      > db.runCommand({insert:"foo", documents:[ {x:1} ], bypassDocumentValidation: NumberInt(1)})
      {
              "ok" : 0,
              "errmsg" : "Wrong type for 'bypassDocumentValidation'. Expected a bool, got a int.",
              "code" : 14
      }
      > db.runCommand({insert:"foo", documents:[ {x:1} ], bypassDocumentValidation: true})
      { "n" : 1, "ok" : 1 }
      

      In released versions, numeric values are accepted.

      Show
      Build a recent mongod from the master branch (e.g. 5f7c803e8dba959e5da4135b76a1d1e05d75636d), run it and connect via mongo: > db.runCommand({insert:"foo", documents:[ {x:1} ], bypassDocumentValidation: 1}) { "ok" : 0, "errmsg" : "Wrong type for 'bypassDocumentValidation'. Expected a bool, got a double.", "code" : 14 } > db.runCommand({insert:"foo", documents:[ {x:1} ], bypassDocumentValidation: NumberInt(1)}) { "ok" : 0, "errmsg" : "Wrong type for 'bypassDocumentValidation'. Expected a bool, got a int.", "code" : 14 } > db.runCommand({insert:"foo", documents:[ {x:1} ], bypassDocumentValidation: true}) { "n" : 1, "ok" : 1 } In released versions, numeric values are accepted.
    • Integrate+Tuning 14 (05/13/16)

    Description

      Perl driver nightly Jenkins runs started failing a few days ago with this error message: Wrong type for 'bypassDocumentValidation'. Expected a bool, got a int

      It looks like the master branch tightened the acceptable types for this option compared to previously released versions of the server.

      Attachments

        Activity

          People

            mathias@mongodb.com Mathias Stearn
            david.golden@mongodb.com David Golden
            Votes:
            0 Vote for this issue
            Watchers:
            11 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: