AI エージェント向け: ドキュメントインデックスは https://www.mongodb.com/ja-jp/docs/llms.txt で利用できます。すべてのページの markdown バージョンは、いずれかの URL パスに .md を追加することで利用できます。
Docs Menu

getCmdLineOpts(データベースコマンド)

getCmdLineOpts

The getCmdLineOpts command returns a document containing command line options used to start the given mongod or mongos. Run getCmdLineOpts in the admin database.

このコマンドは、次の環境でホストされている配置で使用できます。

  • MongoDB Atlas: The fully managed service for MongoDB deployments in the cloud

注意

This command is supported in all MongoDB Atlas clusters. For information on Atlas support for all commands, see Unsupported Commands.

  • MongoDB Enterprise: サブスクリプションベースの自己管理型 MongoDB バージョン

  • MongoDB Community: ソースが利用可能で、無料で使用できる自己管理型の MongoDB のバージョン

このコマンドの構文は、次のとおりです。

db.adminCommand(
{
getCmdLineOpts: 1
}
)

このコマンドは、 argvとparsedの 2 つのフィールドを持つドキュメントを返します。 argvフィールドには、string mongodまたはmongos を呼び出すために使用されるコマンド の各項目を含む配列が含まれています。parsedフィールドのドキュメントには、コマンドラインから解析されたものや構成ファイルで指定されたもの(指定されている場合)を含むすべてのランタイム オプションが含まれます。

Consider the following example output of getCmdLineOpts:

{
"argv" : [
"/usr/bin/mongod",
"--config",
"/etc/mongod.conf"
],
"parsed" : {
"config" : "/etc/mongod.conf",
"net" : {
"bindIp" : "127.0.0.1",
"port" : 27017
},
"processManagement" : {
"fork" : true
},
"storage" : {
"dbPath" : "/data/db"
},
"systemLog" : {
"destination" : "file",
"logAppend" : true,
"path" : "/var/log/mongodb/mongod.log"
}
},
"ok" : 1
}
このページを評価