MongoDb: How to import dump data from .gz file?

Dump command: mongodump –host localhost:27017 –gzip –db Alex –out ./testSO Restore Command: mongorestore –host localhost:27017 –gzip –db Alex ./testSO/Alex Works perfectly! While using archive: Dump command: mongodump –host localhost:27017 –archive=dump.gz –gzip –db Alex Restore Command: mongorestore –host localhost:27017 –gzip –archive=dump.gz –db Alex Note:- While using archive you need to stick with the database name. Different … Read more

How to import dumped Mongodb?

The counterpart to mongodump is mongorestore (and the counterpart to mongoimport is mongoexport) — the major difference is in the format of the files created and understood by the tools (dump and restore read and write BSON files; export and import deal with text file formats: JSON, CSV, TSV. If you’ve already run mongodump, you … Read more

How to use mongoimport to import CSV files?

Your example worked for me with MongoDB 1.6.3 and 1.7.3. Example below was for 1.7.3. Are you using an older version of MongoDB? $ cat > locations.csv Name,Address,City,State,ZIP Jane Doe,123 Main St,Whereverville,CA,90210 John Doe,555 Broadway Ave,New York,NY,10010 ctrl-d $ mongoimport -d mydb -c things –type csv –file locations.csv –headerline connected to: 127.0.0.1 imported 3 objects … Read more

How to use mongoimport to import csv

Your example worked for me with MongoDB 1.6.3 and 1.7.3. Example below was for 1.7.3. Are you using an older version of MongoDB? $ cat > locations.csv Name,Address,City,State,ZIP Jane Doe,123 Main St,Whereverville,CA,90210 John Doe,555 Broadway Ave,New York,NY,10010 ctrl-d $ mongoimport -d mydb -c things –type csv –file locations.csv –headerline connected to: 127.0.0.1 imported 3 objects … Read more