-
Type: Task
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: mongodump
-
1,381
-
(copied to CRM)
When restoring a dump via mongorestore, you can use --nsInclude=<namespace pattern> and/or --nsExclude=<namespace pattern> to filter which namespaces to restore. mongodump allows you to filter out via -excludeCollectionsWithPrefix, but not filter by inclusion.
My particular use case is dumping out the sharding metadata caches from a shard mongod. The caches are collections that start with cache.chunks.NAMESPACE as well as cache.collections and cache.databases. I could exclude other collections within the config database, but I would much rather say include all collections that begin with "cache.".
Even better would be if we supported the more flexible --nsInclude and --nsExclude syntax used by mongorestore so that we could specify namespace by glob patterns.