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

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

flushRouterConfig

flushRouterConfig marks the cached routing table for a sharded cluster as stale, causing the next operation that requests the routing table to refresh the cache. Management of the routing table cache is generally handled automatically by the cluster. You should only need to run the flushRouterConfig command manually in specific instances, as indicated under Considerations.

注意

Running flushRouterConfig is no longer required after executing the movePrimary or dropDatabase commands. These two commands now automatically refresh a sharded cluster's routing table as needed when run.

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

  • MongoDB Atlas はクラウドでの MongoDB 配置のための完全管理サービスです
  • MongoDB Enterprise: サブスクリプションベースの自己管理型 MongoDB バージョン

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

The flushRouterConfig is available on both mongos and mongod instances, and has the following syntax:

  • コレクション名前空間パラメーターで渡される場合、指定されたコレクションのキャッシュをフラッシュします。

    db.adminCommand(
    {
    flushRouterConfig: "<db.collection>"
    }
    )
  • データベース名前空間パラメーターで渡されると、指定されたデータベースとそのコレクションすべてのキャッシュをフラッシュします。

    db.adminCommand(
    {
    flushRouterConfig: "<db>"
    }
    )
  • パラメータなしで実行されるか、string 以外のスカラー値(例: 1 ):

    db.adminCommand("flushRouterConfig")
    db.adminCommand(
    {
    flushRouterConfig: 1
    }
    )

Generally, a sharded cluster's routing table is automatically refreshed as needed as part of normal operation. However, you should manually issue the flushRouterConfig command before running the db.collection.getShardDistribution() command. This ensures that the command returns the most up-to-date information.

このページを評価