PHP » GoLang |
login |
register |
about
|
GoLang MongoDB\Driver\Manager::executeCommand
request it (449)
GoLang replacement for PHP's MongoDB\Driver\Manager::executeCommand
[edit | history]
PHP MongoDB\Driver\Manager::executeCommandPHP original manual for MongoDB\Driver\Manager::executeCommand [ show | php.net ]MongoDB\Driver\Manager::executeCommand(mongodb >=1.0.0) MongoDB\Driver\Manager::executeCommand — Execute a database command Description
final public MongoDB\Driver\Cursor MongoDB\Driver\Manager::executeCommand
( string
$db
, MongoDB\Driver\Command $command
[, array $options = array()
] )Selects a server according to the "readPreference" option and executes the command on that server. By default, the read preference from the MongoDB Connection URI will be used. This method applies no special logic to the command. Although this method accepts "readConcern" and "writeConcern" options, which will be incorporated into the command document, those options will not default to corresponding values from the MongoDB Connection URI nor will the MongoDB server version be taken into account. Users are therefore encouraged to use specific read and/or write command methods if possible. Parameters
Return ValuesReturns MongoDB\Driver\Cursor on success. Errors/Exceptions
Changelog
ExamplesExample #1 MongoDB\Driver\Manager::executeCommand() with a command returning a single result document
<?php The above example will output: array(1) { ["ok"]=> float(1) } Example #2 MongoDB\Driver\Manager::executeCommand() with a command returning a cursor
<?php The above example will output: object(stdClass)#6 (2) { ["_id"]=> string(3) "bar" ["sum"]=> int(10) } object(stdClass)#7 (2) { ["_id"]=> string(3) "foo" ["sum"]=> int(2) } Notes
See Also
|
more
Recently updated
more
Most requested
more
Last requests
|