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

mongodump: allow -c to be defined multiple times

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: mongodump
    • 1,885
    • Needed
    • Document that `--collection` can be specified multiple times.

      Since 3.2, mongodump has supported dumping multiple collections into a single archive file. However, it seems there is no sane way of providing multiple specific collections to dump.

      In our use-case, we want to backup two large collections separately from the rest. We can dump the rest using two `--excludeCollection` arguments, but you can't use two `--collection` arguments - only the latter one will be used.

      The only way I can figure out to dump the two collections is to first query a list of all collection names in the DB, filter out the two we want to export, and then generate a list of `--excludeCollection` arguments to exclude all but the two we want.

            Assignee:
            Unassigned Unassigned
            Reporter:
            sampo Sampo Juustila
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: