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

mongodump: allow -c to be defined multiple times

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Accepted
    • Priority: Major - P3
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: mongodump
    • Labels:
    • Documentation Changes:
      Needed
    • Documentation Changes Summary:
      Document that `--collection` can be specified multiple times.

      Description

      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.

        Attachments

          Activity

            People

            Assignee:
            backlog-server-tools Backlog - Server Tools Team
            Reporter:
            sampo Sampo Juustila
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: