Home  >  Article  >  Database  >  How to import json data into MongoDB

How to import json data into MongoDB

不言
不言forward
2018-10-10 11:03:285841browse

The content of this article is about the method of importing json data into MongoDB. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.

json data

How to import json data into MongoDB

Enter the import command in the terminal:

mongoimport --db dbName --collection collectionName --file filePath

Actual specific command:

mongoimport --db mall --collection userData --file /Users/yeo/Desktop/userdata.json

How to import json data into MongoDB

Go to the database again to see if the import is successful

How to import json data into MongoDB

The import is successful.

The above is the detailed content of How to import json data into MongoDB. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:segmentfault.com. If there is any infringement, please contact admin@php.cn delete