Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-1366

Schema validation (not JSON schema) errors ignored by driver

    • Type: Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.2.34, 3.0.4
    • Component/s: Native
    • Labels:
    • Environment:
      MongoDB 3.2+, node-mongodb-native 2.2+

      I noticed this with the node-mongodb-native driver at v2.2, when we started using schema validations.

      Any violation of a schema validator will cause MongoDB to not accept the insert/update, but the driver will return result:

      { ok: 1 }

      anyway. If the op is an insert, it'll also return the "inserted" doc, and add an .insertedId ObjectId property, which of course matches nothing in the database since the insert op failed.

      I thought it might be because 2.2 of the driver predated the schema validation feature, but having just upgraded to v3.0, I can confirm that the issue remains.

      It seems to me like a bug, but maybe I need to be schooled a bit?

      Cheers,
      Daniel

            Assignee:
            Unassigned Unassigned
            Reporter:
            Daniel Smedegaard Buus Daniel Smedegaard Buus [X]
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: