简体   繁体   中英

Import external JSON-files to MongoDB

I have a large number of JSON-files that I need to import to my Mongo database, I have also defined a schema in Mongoose, with the exact same format as my JSON-files.

Is there any way to use the terminal to import all the files to my database?

This is straight from the docs.  

mongoimport --db users --collection contacts --file contacts.json

Also look at this thread as another person ran into some issues

Mongoimport of json file

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM