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 the isdbgridfield set to 1. The returned document is similar to thefollowing:

  1. { "isdbgrid" : 1, "hostname" : "app.example.net", "ok" : 1 }

If you issue the isdbgrid command when connected to amongod, MongoDB returns an error document. Theisdbgrid command is not available to mongod.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:

  1. {
  2. "errmsg" : "no such cmd: isdbgrid",
  3. "bad cmd" : {
  4. "isdbgrid" : 1
  5. },
  6. "ok" : 0
  7. }

You can instead use the isMaster command to determineconnection to a mongos. When connected to amongos, the isMaster command returns a document thatcontains the string isdbgrid in the msg field.