I. Overview
This blog is about how MONGO db imports and exports data, as well as backup data.
The
service side of MONGO DB needs to be opened in order to operate.
Second, export.
the export of MongoDB is very simple open cmd input below command
mongoexport-d foobar-c persons-o D:/persons.json
If you are importing a database document for another host, write this
Mongoexport--host 192.168.0.16--port 37017
Third, import
It's also very simple open cmd input below command
Mongoimport--db foobar--collection persons--file D:/persons.json
Iv. Backup
MongoDB backup very simple open cmd enter the following command
Mongodump--host 127.0.0.1:27017-d Foobar-o D:/foobar
Recovering data is also very simple open cmd input below command
Mongorestore--host 127.0.0.1:27017-d Foobar-directoryperdb D:/foobar/foobar
V. Summary
Import, export, backup these operations are often used in the operation of this blog is to introduce these to you.
Java from getting started to mastering--database article MONGO DB Export, import, backup