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 handled automatically by the cluster.

注意

Running flushRouterConfig is no longer required after executing movePrimary, dropDatabase, or db.collection.getShardDistribution(). These 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:

  • Flush the cache for a specified collection when passed in a collection namespace parameter:

    db.adminCommand(
    {
    flushRouterConfig: "<db.collection>"
    }
    )
  • Flush the cache for a specified database and all of its collections when passed in a database namespace parameter:

    db.adminCommand(
    {
    flushRouterConfig: "<db>"
    }
    )
  • Flush the cache for all databases and their collections when run without a parameter or passed in a non-string scalar value (e.g. 1):

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