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?
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