Java from getting started to mastering--database article MONGO DB Export, import, backup

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.