Soham Krishna Paul
Soham Krishna Paul
Node JS Developer PHP Developer React-Native Developer React JS Developer Web Developer
Soham Krishna Paul

Blog

How to restore the dump into your running mongodb

How to restore the dump into your running mongodb

Dump DB by mongodump

mongodump --host  -d  --port  --out directory

Restore DB by mongorestore

With Index Restore

mongorestore --host  -d  --port  foldername

Without Index Restore

mongorestore --noIndexRestore --host  -d  --port  foldername

Import Single Collection from CSV [1st Column will be treat as Col/Key Name]

mongoimport --db  --port  --collection  --type csv --headerline --file /path/to/myfile.csv

Import Single Collection from JSON

mongoimport --db  --port  --collection  --file input.json

Add Comment