(mongodb >=1.4.0)
MongoDB\Driver\Manager::executeWriteCommand — Execute a database command that writes
$db
   , MongoDB\Driver\Command $command
   [, array $options = array()
  ] ) : MongoDB\Driver\CursorExecutes the command on the primary server.
This method will apply logic that is specific to commands that write (e.g. » drop) and take the MongoDB server version into account. The "writeConcern" option will default to the corresponding value from the MongoDB Connection URI.
Nota: This method is not intended to be used to execute » insert, » update, or » delete commands. Users are encouraged to use MongoDB\Driver\Manager::executeBulkWrite() for those commands.
db (string)El nombre de la base de datos en la que ejecutar el comando.
command (MongoDB\Driver\Command)El comando a ejecutar.
options
| Option | Type | Description | 
|---|---|---|
| session | MongoDB\Driver\Session | Una sesión a asociar con la operación. | 
| writeConcern | MongoDB\Driver\WriteConcern | Un asunto de escritura a aplicar a la operación. | 
Si se usa la opción "session" con sesión que tenga una transacción en progreso, no se puede especificar una opción "readConcern" o "writeConcern". Esto resultarña en una MongoDB\Driver\Exception\InvalidArgumentException. En su lugar se debería establecer estas dos opciones al crear la transacción con MongoDB\Driver\Session::startTransaction().
Devuelve un MongoDB\Driver\Cursor en caso de éxito.
| Versión | Descripción | 
|---|---|
| 1.4.4 | MongoDB\Driver\Exception\InvalidArgumentException will be thrown if the "session" option is used in combination with an unacknowledged write concern. |