Docs Menu

isdbgrid

이 페이지의 내용

isdbgrid

This command verifies that a process is a mongos.

If you issue the isdbgrid command when connected to a mongos, the response document includes the isdbgrid field set to 1.

이 명령은 다음 환경에서 호스팅되는 배포에서 사용할 수 있습니다.

  • MongoDB Atlas: 클라우드에서의 MongoDB 배포를 위한 완전 관리형 서비스

참고

이 명령은 모든 MongoDB Atlas 클러스터에서 지원됩니다. 모든 명령에 대한 Atlas 지원에 관해 자세히 알아보려면 지원되지 않는 명령을 참조하십시오.

명령은 다음과 같은 구문을 가집니다:

db.runCommand(
{
isdbgrid: 1
}
)

The returned document is similar to the following:

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

If you issue the isdbgrid command when connected to a mongod, MongoDB returns an error document. The isdbgrid 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 a mongos. The error document is similar to the following:

{
"errmsg" : "no such cmd: isdbgrid",
"bad cmd" : {
"isdbgrid" : 1
},
"ok" : 0
}

You can instead use the hello command to determine connection to a mongos. When connected to a mongos, the hello command returns a document that contains the string isdbgrid in the msg field.

이 페이지의 내용