Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-5672

mongorestore with --drop option

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • mongodb-3.0
    • None
    • None

    Description

      http://docs.mongodb.org/manual/reference/program/mongorestore/#cmdoption--drop

      The --drop option for mongorestore states "Modifies the restoration procedure to drop every collection from the target database before restoring the collection from the dumped backup."

      This should be reworded based on the current behavior. The --drop will not affect collections in the target database, if they are not in the dump. For example:

      1. Create DB abc
      2. Create collections c1 & c2 and populate
      3. mongodump abc
      4. Create collection c3 and populate
      5. Add documents to c1 & c2
      6. mongorestore abc --drop

      The collections c1 & c2 will be restored from the dump, but c3 will still exist with the documents.

      CC: mpobrien Please confirm this is the expected behavior.

      Attachments

        Activity

          People

            kay.kim@mongodb.com Kay Kim (Inactive)
            jonathan.abrahams Jonathan Abrahams
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              8 years, 34 weeks, 2 days ago