Can I Import Export all collections on MongoDB?
The answers is YES. π
✋✋✋✋ Hello everybody, welcome to Learn Tech Tips channel, I am Zidane (chinese nick name is :ιθ π₯π₯π₯π₯π₯π₯π₯π₯). Nice to see you all, enjoy my technical blog
Many people when working with MongoDB but they cannot import or export data from Mongo Database,
Today I want to share with you how to use import and export on MongoDB.
Just with simple step you can handle it and save you a lots time about import and export data on MongoDB
π― Let's start!!!
Go inside below mongo link for download mongo db tools
Belongto to your environment (MacOS, Window, Linux), you can choose your fitable to download database tools
Import and export with each collections
Export on MongoDB
Import on MongoDB
or you can go inside the mongodb compass for import directly
Import and export ALL Collections
Export all collections:
Example:
mongodump --uri “mongodb+srv://Admin:Zidane@appcluster.15lf4.mongodb.net/mytestdb” -o ./mongo-backup
Import all collections:
Example:
mongorestore “mongodb+srv://Admin:Zidane@appcluster.15lf4.mongodb.net/mytestdb” -./mongo-backup/
Is it easy to working with about command.
You can reference here also:
https://www.mongodb.com/docs/database-tools/mongodump/
https://www.mongodb.com/docs/database-tools/mongorestore/
https://www.mongodb.com/docs/database-tools/mongoimport/
https://www.mongodb.com/docs/database-tools/mongoexport/