Uploaded image for project: 'PHP Driver: Extension'
  1. PHP Driver: Extension
  2. PHPC-712

Driver should validate BSON documents before insert and update

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.3.0-beta1, 1.3.0
    • Affects Version/s: 1.1.7
    • Component/s: None
    • Labels:
      None

      The driver currently does not validate documents for insert or update:

      $bulk = new MongoDB\Driver\BulkWrite;
      $bulk->insert(['foo.bar' => 1]);
      $bulk->insert(['x' => ['foo.bar' => 1]]);
      
      $manager = new MongoDB\Driver\Manager(URI);
      $manager->executeBulkWrite('test.foo', $bulk);
      

      libmongoc's bulk write API does not validate documents for us. We will want to use the same logic (and validation flags) found in the relevant libmongoc collection methods.

            Assignee:
            jmikola@mongodb.com Jeremy Mikola
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: