@@ -8,18 +8,21 @@ isdbgrid
8
8
9
9
This command verifies that a process is a :program:`mongos`.
10
10
11
- If you issue the :dbcommand:`isdbgrid` command when connected to a :program:`mongos`, the response document
12
- resembles the following:
11
+ If you issue the :dbcommand:`isdbgrid` command when connected to a
12
+ :program:`mongos`, the response document includes the ``isdbgrid``
13
+ field set to ``1``. The returned document is similar to the
14
+ following:
13
15
14
16
.. code-block:: javascript
15
17
16
18
{ "isdbgrid" : 1, "hostname" : "app.example.net", "ok" : 1 }
17
19
18
- However, if you issue the :dbcommand:`isdbgrid` command when conneted
19
- to a :program:`mongod`, the returned document also might include a
20
- line that reads ``"isdbgrid" : 1``, though in this case as part of an
21
- error message. The :dbcommand:`isdbgrid` command is not available to
22
- :program:`mongod` and returns an error document similar to the following:
20
+ If you issue the :dbcommand:`isdbgrid` command when connected to a
21
+ :program:`mongod`, MongoDB returns an error document. The
22
+ :dbcommand:`isdbgrid` command is not available to :program:`mongod`.
23
+ The error document, however, also includes a line that reads
24
+ ``"isdbgrid" : 1``, just as in the document returned for a
25
+ :program:`mongos`. The error document is similar to the following:
23
26
24
27
.. code-block:: javascript
25
28
@@ -33,6 +36,6 @@ isdbgrid
33
36
34
37
You can instead use the :dbcommand:`isMaster` command to determine
35
38
connection to a :program:`mongos`. When connected to a
36
- :program:`mongos`, the :dbcommand:`isMaster` returns a document that
39
+ :program:`mongos`, the :dbcommand:`isMaster` command returns a document that
37
40
contains the string ``isdbgrid`` in the ``msg`` field.
38
41
0 commit comments