File tree Expand file tree Collapse file tree 1 file changed +5
-22
lines changed Expand file tree Collapse file tree 1 file changed +5
-22
lines changed Original file line number Diff line number Diff line change @@ -43,8 +43,8 @@ Errors/Exceptions
4343Example
4444-------
4545
46- The following example executes an :manual:`isMaster
47- </reference/command/isMaster >` command, which returns a cursor with a single
46+ The following example executes a :manual:`ping
47+ </reference/command/ping >` command, which returns a cursor with a single
4848result document:
4949
5050.. code-block:: php
@@ -53,32 +53,15 @@ result document:
5353
5454 $database = (new MongoDB\Client)->test;
5555
56- $cursor = $database->command(['isMaster ' => 1]);
56+ $cursor = $database->command(['ping ' => 1]);
5757
5858 var_dump($c->toArray()[0]);
5959
6060The output would resemble::
6161
6262 object(MongoDB\Model\BSONDocument)#11 (1) {
6363 ["storage":"ArrayObject":private]=>
64- array(8) {
65- ["ismaster"]=>
66- bool(true)
67- ["maxBsonObjectSize"]=>
68- int(16777216)
69- ["maxMessageSizeBytes"]=>
70- int(48000000)
71- ["maxWriteBatchSize"]=>
72- int(1000)
73- ["localTime"]=>
74- object(MongoDB\BSON\UTCDateTime)#3 (1) {
75- ["milliseconds"]=>
76- string(13) "1477608046464"
77- }
78- ["maxWireVersion"]=>
79- int(4)
80- ["minWireVersion"]=>
81- int(0)
64+ array(1) {
8265 ["ok"]=>
8366 float(1)
8467 }
@@ -94,7 +77,7 @@ multiple result documents:
9477
9578 $database = (new MongoDB\Client)->test;
9679
97- $cursor = $database->command(['isMaster ' => 1]);
80+ $cursor = $database->command(['listCollections ' => 1]);
9881
9982 var_dump($c->toArray());
10083
You can’t perform that action at this time.
0 commit comments