Results of 1 - 2 of about 2 for buildInfo (0.001 sec.)
- The MongoDB\Driver\ServerApi class | PHP 8.3 11228
- The MongoDB\Driver\ServerApi class (mongodb >=1.10.0) はじめに クラス概要 final class MongoDB\Driver\ServerApi implements MongoDB\BSON\Serializable , Serializable { /* 定数 */ const string MongoDB\Driver\ServerAPI::V1 = "1" ; /* メソッド */
... nager = new Manager ( 'mongodb://localhost:27017' , [], [ 'serverApi' => $v1 ]); $command = new MongoDB\Driver\Command ([ 'buildInfo' => 1 ]); try { $cursor = $manager -> executeCommand ( 'admin' , $command ); } catch( MongoDB\Driver\Exception $e ) { echo ... $e -> getMessage (), "\n" ; exit; } /* The buildInfo command returns a single result document, so we need to access * the first result in the cursor. */ $buildInfo = $cursor - ... > toArray ()[ 0 ]; echo $buildInfo -> version , "\n" ; ?> 上の例の出力は以下となります。 4.9.0-alpha7-49-gb968ca0 例2 Declare a strict API version on a manag ...
-
https://man.mtool.work/php/8.3/class.mongodb-driver-serverapi.html
- MongoDB\Driver\Command::__construct — Create a new Command | PHP 8.3 7485
- MongoDB\Driver\Command::__construct (mongodb >=1.0.0) MongoDB\Driver\Command::__construct — Create a new Command 説明 final public function MongoDB\Driver\Command::__construct ( array | object $document , ? array $commandOptions = null ) Co
... ?php $manager = new MongoDB\Driver\Manager ( "mongodb://localhost:27017" ); $command = new MongoDB\Driver\Command (array( "buildinfo" => 1 )); try { $cursor = $manager -> executeCommand ( "admin" , $command ); $response = $cursor -> toArray ()[ 0 ]; } cat ...
-
https://man.mtool.work/php/8.3/mongodb-driver-command.construct.html
PREV
1
NEXT