This version of the documentation is archived and no longer
supported. View the current documentation to learn how to
upgrade your version of MongoDB.
isdbgridThis command verifies that a process is a
mongos.If you issue the
isdbgridcommand when connected to amongos, the response document includes theisdbgridfield set to1. The returned document is similar to the following:{ "isdbgrid" : 1, "hostname" : "app.example.net", "ok" : 1 } If you issue the
isdbgridcommand when connected to amongod, MongoDB returns an error document. Theisdbgridcommand 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:{ "errmsg" : "no such cmd: isdbgrid", "bad cmd" : { "isdbgrid" : 1 }, "ok" : 0 } You can instead use the
hellocommand to determine connection to amongos. When connected to amongos, thehellocommand returns a document that contains the stringisdbgridin themsgfield.