|
41 | 41 | use MongoDB\Model\BSONArray;
|
42 | 42 | use MongoDB\Model\BSONDocument;
|
43 | 43 | use MongoDB\Model\DatabaseInfo;
|
44 |
| -use MongoDB\Operation\ClientBulkWrite; |
| 44 | +use MongoDB\Operation\ClientBulkWriteCommand; |
45 | 45 | use MongoDB\Operation\DropDatabase;
|
46 | 46 | use MongoDB\Operation\ListDatabaseNames;
|
47 | 47 | use MongoDB\Operation\ListDatabases;
|
@@ -193,26 +193,26 @@ final public function addSubscriber(Subscriber $subscriber): void
|
193 | 193 | }
|
194 | 194 |
|
195 | 195 | /**
|
196 |
| - * Executes multiple write operations. |
| 196 | + * Executes multiple write operations across multiple namespaces. |
197 | 197 | *
|
198 |
| - * @see ClientBulkWrite::__construct() for supported options |
199 |
| - * @param string $databaseName Database name |
200 |
| - * @param array $options Additional options |
| 198 | + * @param BulkWriteCommand|ClientBulkWrite $bulk Assembled bulk write command or builder |
| 199 | + * @param array $options Additional options |
201 | 200 | * @throws UnsupportedException if options are unsupported on the selected server
|
202 | 201 | * @throws InvalidArgumentException for parameter/option parsing errors
|
203 | 202 | * @throws DriverRuntimeException for other driver errors (e.g. connection errors)
|
| 203 | + * @see ClientBulkWriteCommand::__construct() for supported options |
204 | 204 | */
|
205 |
| - public function bulkWrite(BulkWriteCommand|BulkWriteCommandBuilder $bulk, array $options = []): ?BulkWriteCommandResult |
| 205 | + public function bulkWrite(BulkWriteCommand|ClientBulkWrite $bulk, array $options = []): ?BulkWriteCommandResult |
206 | 206 | {
|
207 | 207 | if (! isset($options['writeConcern']) && ! is_in_transaction($options)) {
|
208 | 208 | $options['writeConcern'] = $this->writeConcern;
|
209 | 209 | }
|
210 | 210 |
|
211 |
| - if ($bulk instanceof BulkWriteCommandBuilder) { |
| 211 | + if ($bulk instanceof ClientBulkWrite) { |
212 | 212 | $bulk = $bulk->bulkWriteCommand;
|
213 | 213 | }
|
214 | 214 |
|
215 |
| - $operation = new ClientBulkWrite($bulk, $options); |
| 215 | + $operation = new ClientBulkWriteCommand($bulk, $options); |
216 | 216 | $server = select_server_for_write($this->manager, $options);
|
217 | 217 |
|
218 | 218 | return $operation->execute($server);
|
|
0 commit comments