重要
mongosh メソッド
This page documents a mongosh method. This is not the documentation for database commands or language-specific drivers, such as Node.js.
データベースコマンドについては、collStats コマンドによって返される totalIndexSize フィールドを参照してください。
MongoDB API ドライバーについては、各言語の「MongoDB ドライバーのドキュメント」を参照してください。
定義
db.collection.totalIndexSize()次の値を返します。 コレクションのすべてのインデックスの合計サイズ。
インデックスが接頭辞圧縮(
default for WiredTiger)を使用している場合、返されるサイズは圧縮されたサイズを反映します。レプリカセット ノードで
collStats操作を実行するには、ノードがPRIMARYまたはSECONDARY状態である必要があります。 ノードがSTARTUP2などの別の状態にある場合、操作はエラーになります。
互換性
このメソッドは、次の環境でホストされている配置で使用できます。
- 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 のバージョン