@@ -47,12 +47,12 @@ parameters in a command document, then pass the command document to the
47
47
``command()`` method. This method returns a ``Cursor`` object.
48
48
49
49
The following code shows how you can use the ``command()``
50
- method to run the ``hello`` command, which returns information about
51
- the current member's role in the replica set, on a database :
50
+ method on a database to run the ``hello`` command, which returns
51
+ information about the current member's role in the replica set:
52
52
53
53
.. code-block:: php
54
54
55
- $result = $database->command(['ping ' => 1]);
55
+ $result = $database->command(['hello ' => 1]);
56
56
57
57
To find a link to a full list of database commands and corresponding
58
58
parameters, see the :ref:`Additional Information section
@@ -77,7 +77,7 @@ parameters, see the :ref:`Additional Information section
77
77
);
78
78
79
79
For more information on read preference options, see :manual:`Read
80
- Preference </core/read-preference/>` in the Server manual.
80
+ Preference </core/read-preference/>` in the {+mdb-server+} manual.
81
81
82
82
.. _php-command-response:
83
83
@@ -109,12 +109,9 @@ response contains a document with the following fields:
109
109
110
110
* - ``operationTime``
111
111
- The logical time of the operation. MongoDB uses the
112
- logical time to order operations.
113
-
114
- .. seealso::
115
-
116
- To learn more about logical time, see our blog post about the
117
- :website:`Global Logical Clock </blog/post/transactions-background-part-4-the-global-logical-clock>`.
112
+ logical time to order operations. To learn more about this
113
+ concept, see our blog post about the :website:`Global Logical
114
+ Clock </blog/post/transactions-background-part-4-the-global-logical-clock>`.
118
115
119
116
* - ``$clusterTime``
120
117
- A document that contains the signed cluster time. Cluster time is a
@@ -126,26 +123,22 @@ response contains a document with the following fields:
126
123
- ``signature``, a document that contains the hash of the cluster time and the ID
127
124
of the key used to sign the cluster time
128
125
129
- .. _rust -command-example:
126
+ .. _php -command-example:
130
127
131
128
Command Example
132
129
---------------
133
130
134
- The following code shows how you can use the ``command()`` method to run
135
- the ``explain`` command for a ``count`` operation on the ``flowers``
136
- collection of the ``plants`` database. The ``explain`` command runs in the
137
- ``"queryPlanner"`` verbosity mode:
131
+ The following example uses the ``command()`` method to run
132
+ the ``explain`` command for a ``count`` operation. The ``explain``
133
+ command runs in the ``queryPlanner`` verbosity mode:
138
134
139
135
.. literalinclude:: /includes/write/run-command.php
140
136
:language: php
141
137
:dedent:
142
138
:start-after: start-runcommand
143
139
:end-before: end-runcommand
144
140
145
- Output
146
- ~~~~~~
147
-
148
- The output includes fields explaining the
141
+ The output of this command includes fields explaining the
149
142
execution of the ``count`` operation, such as the winning plan, which is
150
143
the plan selected by the query optimizer, and any rejected
151
144
plans. The output also contains information about the execution of the
@@ -169,7 +162,7 @@ Additional Information
169
162
----------------------
170
163
171
164
For more information about the concepts in this guide, see the following
172
- documentation in the Server manual:
165
+ documentation in the {+mdb-server+} manual:
173
166
174
167
- :manual:`db.runCommand() </reference/method/db.runCommand/>`
175
168
- :manual:`Database Commands </reference/command/>`
@@ -180,3 +173,4 @@ API Documentation
180
173
~~~~~~~~~~~~~~~~~
181
174
182
175
- `MongoDB\\Database::command() <{+api+}/method/MongoDBDatabase-command/>`__
176
+ - `ReadPreference <https://www.php.net/manual/en/class.mongodb-driver-readpreference.php>`__
0 commit comments