The first step is to find the MongoDB installation directory
Step two, go to the bin directory in the MongoDB installation directory from the command line
Attached: http://www.runoob.com/mongodb/mongodb-create-database.html MongoDB operation Daquan
Step three (1), Export the Data command (the exported file has two formats: Json/csv, the JSON file is exported here, for exporting the CSV file you need to specify a variable-field ' for the Field name '):
Mongoexport-h the host address of the database (if local is 127.0.0.1, if remote is the remote address IP)-D to export the database name-C collection name-o output more JSON file path
Example of exporting a CSV file: Mongoexport-h host address-D database name-C collection name--csv--field field List-O output address
Practical Example: Mongoexport-h 127.0.0.1-d test_new-c mycolle-o D:\Database\temp\mycolle.json
Under F-plate
Step Three (2), Import Data command (I'm using a JSON-formatted file here):
Mongoimport--DB database name--collection collection name (table name in relational database)--file JSON file specific path (for example: D:\Company\test\test.json)
Practical Example: Mongoimport--db xxx_name--collection Mycolle--file D:/database/temp/mycolle.json
--collection: When importing data, the corresponding collection name must match the name of the collection under the--file path, otherwise the following error will occur, which is an easily ignored pit
MONGO database operation/Database version number