- Reference >
- Database Commands >
- Sharding Commands >
- isdbgrid
isdbgrid¶
-
isdbgrid
¶ This command verifies that a process is a
mongos
.If you issue the
isdbgrid
command when connected to amongos
, the response document includes theisdbgrid
field set to1
. The returned document is similar to the following:If you issue the
isdbgrid
command when connected to amongod
, MongoDB returns an error document. Theisdbgrid
command is not available tomongod
. The error document, however, also includes a line that reads"isdbgrid" : 1
, just as in the document returned for amongos
. The error document is similar to the following:You can instead use the
isMaster
command to determine connection to amongos
. When connected to amongos
, theisMaster
command returns a document that contains the stringisdbgrid
in themsg
field.