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

The local Database

すべての mongod インスタンスには独自の local データベースがあり、レプリケーションプロセスで使用されるデータやその他のインスタンス固有のデータが格納されます。local データベース内のコレクションは複製されません。

local.startup_log

On startup, each mongod instance inserts a document into startup_log with diagnostic information about the mongod instance itself and host information. startup_log is a capped collection. This information is primarily useful for diagnostic purposes.

For example, the following is a prototype of a document from the startup_log collection:

{
"_id" : "<string>",
"hostname" : "<string>",
"startTime" : ISODate("<date>"),
"startTimeLocal" : "<string>",
"cmdLine" : {
"dbpath" : "<path>",
"<option>" : <value>
},
"pid" : <number>,
"buildinfo" : {
"version" : "<string>",
"gitVersion" : "<string>",
"sysInfo" : "<string>",
"loaderFlags" : "<string>",
"compilerFlags" : "<string>",
"allocator" : "<string>",
"versionArray" : [ <num>, <num>, <...> ],
"javascriptEngine" : "<string>",
"bits" : <number>,
"debug" : <boolean>,
"maxBsonObjectSize" : <number>
}
}

Documents in the startup_log collection contain the following fields:

local.startup_log._id

システムホスト名とミリ秒のエポック値が含まれます。

local.startup_log.hostname

システムのホスト名。

local.startup_log.startTime

サーバーの起動時刻を反映する UTC のISODate 値。

local.startup_log.startTimeLocal

A string that reports the startTime in the system's local time zone.

local.startup_log.cmdLine

mongodランタイム オプションとその値を報告する埋め込みドキュメント。

local.startup_log.pid

このプロセスのプロセス識別子。

local.startup_log.buildinfo

このmongodをコンパイルするために使用されたビルド環境と設定に関する情報を報告する埋め込みドキュメント。これはbuildInfoと同じ出力です。buildInfoを参照してください。

local.system.replset

local.system.replset holds the replica set's configuration object as its single document. To view the object's configuration information, issue rs.conf() from mongosh. You can also query this collection directly.

local.oplog.rs

local.oplog.rs is the capped collection that holds the oplog. You set its size at creation using the oplogSizeMB setting. To resize the oplog after replica set initiation, use the Change the Oplog Size of Self-Managed Replica Set Members procedure. For additional information, see the Oplog Size section.

oplog は、majority commit point が削除されるのを回避するために、設定されたサイズ制限を超えて大きくなることがあります。

MongoDB 5.0 以降では、 oplogへの手動書き込み操作が制限されています。詳細については、 「Oplog コレクションの動作」 を参照してください。

local.replset.minvalid

これには、レプリカセットがレプリケーションステータスを追跡するために内部的に使用するオブジェクトが含まれています。

マルチドキュメントトランザクション local
マルチドキュメントトランザクション内では、local データベース内のコレクションに対して読み取り/書き込み操作を実行することはできません。
再試行可能な書き込み再試行可能な書込み local

再試行可能な書き込みが有効になっていると、 localデータベース内のコレクションへの書込み操作は実行できません。

重要

公式のMongoDBドライバーでは、デフォルトで 再試行可能な書き込みが有効になっています。localデータベースに書き込むアプリケーションでは、再試行可能な書き込みが明示的に無効になっていない限り、書き込みエラーが発生します。

再試行可能な書き込みを無効にするには、MongoDB の接続文字列retryWrites=false を指定します。