Uploaded image for project: 'MongoDB Database Tools'
  1. MongoDB Database Tools
  2. TOOLS-2382

Add --includeCollectionsWithPrefix to mongodump

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: mongodump
    • 1,381

      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.

            Assignee:
            Unassigned Unassigned
            Reporter:
            james.kovacs@mongodb.com James Kovacs
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: