bypassDocumentValidation no longer accepts numeric types

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • 3.3.6
    • Affects Version/s: None
    • Component/s: 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)
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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.

            Assignee:
            Mathias Stearn
            Reporter:
            David Golden
            Votes:
            0 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved: