-
Type: Improvement
-
Resolution: Done
-
Priority: Critical - P2
-
Affects Version/s: 1.0.0-beta1
-
Component/s: None
-
None
executeUpdate() and executeDelete() currently take an options array (between the query arguments and WriteConcern); however, executeBulkWrite() and executeInsert() do not and BulkWrite's constructor only takes a boolean $ordered argument.
Current protos:
- public function Manager::executeBulkWrite(string $namespace, BulkWrite $bulk, ?WriteConcern $writeConcern = null): WriteResult
- public function Manager::executeInsert(string $namespace, mixed $document, ?WriteConcern $writeConcern = null): WriteResult
- public function BulkWrite::__construct(boolean $ordered)
This leaves no way to support a "bypassDocumentValidation" option at the basic driver level. We will need to change these prototypes to allow passing of such an option (and perhaps others down the line). Since we can create a BulkWrite with options, there is no need to change executeBulkWrite().
Proposed protos:
- public function Manager::executeInsert(string $namespace, mixed $document, ?array $insertOptions = [], ?WriteConcern $writeConcern = null): WriteResult
- public function BulkWrite::__construct(?array $bulkWriteOptions = [])
Actually implementation of "bypassDocumentValidation" will be handled by PHPC-443. This issue only pertains to modifying our public API to support an options array, to which we'll later add "bypassDocumentValidation".