flushRouterConfig
flushRouterConfig
flushRouterConfig
clears the cached routing table. Usethis command to force a refresh of the routing table cache. In mostcases, this happens automatically. You should only need to runflushRouterConfig
aftermovePrimary
hasbeen run or after manually clearing thejumbo
chunk flag.Starting in MongoDB 4.0.6 (and 3.6.11),
flushRouterConfig
is available on bothmongos
instances andmongod
instances and can:- Flush the cache for a specified collection when passed in acollection namespace parameter:
- db.adminCommand({ flushRouterConfig: "<db.collection>" } )
-
Flush the cache for a specified database and its collectionswhen passed in a database namespace parameter:
- db.adminCommand({ flushRouterConfig: "<db>" } )
-
Flush the cache for all databases and their collections when runwithout a parameter or passed in a non-string scalar value (e.g. 1
):
- db.adminCommand("flushRouterConfig")
- db.adminCommand( { flushRouterConfig: 1 } )
- In MongoDB 4.0.5 and earlier (and 3.6.10 and earlier),
flushRouterConfig
is only available formongos
instances and can flush the cache for alldatabases and their collections:
- db.adminCommand("flushRouterConfig")
- db.adminCommand( { flushRouterConfig: 1 } )
Considerations
You should only need to run flushRouterConfig
aftermovePrimary
has been run or after manually clearing thejumbo
chunk flag.
See also