-
Type: Task
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: mongodump
-
1,885
-
Needed
-
Document that `--collection` can be specified multiple times.
-
(copied to CRM)
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.