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

mongoexport: option to export an entire database

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Won't Fix
    • Affects Version/s: Legacy C++ Implementation
    • Fix Version/s: None
    • Component/s: mongoexport
    • Labels:
      None

      Description

      mongoexport should work similarly to mongodump in that it should dump all a db's collections to json files, rather than having to specify a single collection.

        Issue Links

          Activity

          Hide
          zach.snow Zach Snow added a comment -

          mongoexport is not intended to produce dumps of entire databases. Further, the formats mongoexport produces (CSV or JSON) are incapable of accurately capturing the information stored in MongoDB. CSV provides no typing at all, while JSON lacks many of the types allowed in the BSON spec.

          That said, it is possible to produce a JSON dump of each collection in the database using the two commands below:

          $ mongodump
          $ for file in dump/*/*.bson; do bsondump $file > $file.json; done
          

          Show
          zach.snow Zach Snow added a comment - mongoexport is not intended to produce dumps of entire databases. Further, the formats mongoexport produces (CSV or JSON) are incapable of accurately capturing the information stored in MongoDB. CSV provides no typing at all, while JSON lacks many of the types allowed in the BSON spec . That said, it is possible to produce a JSON dump of each collection in the database using the two commands below: $ mongodump $ for file in dump/*/*.bson; do bsondump $file > $file.json; done
          Hide
          refack Refael Ackermann added a comment -

          I find it a little bit dismissive to close this bug as won't fix after it being open for 7 years

          Show
          refack Refael Ackermann added a comment - I find it a little bit dismissive to close this bug as won't fix after it being open for 7 years

            People

            • Assignee:
              backlog-server-tools Backlog - Server Tools Team
              Reporter:
              digitala Phillip Oldham
            • Votes:
              6 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: