A tool to quickly populate your mongo db from a set of .json files
- Run
npm install node-mongo-seeds --save - Run
npm run node-mongo-seeds setup - Replace
"localhost/CHANGE_ME_TO_YOUR_DB_NAME"with the path to your mongodb in your brand new seed.json file - Create a
/seedsfolder in your project root and put.jsonfiles in there. The name of the file is going to be the collection name in mongo and the contents of the file will be populated into that mongo collection. - Run
npm run node-mongo-seeds seedto seed your mongodb with all your data from your/seedsfolder.
Note: Every time you run npm run node-mongo-seeds seed it will blow away all the data in your collections and re-populate them with whatever is in your /seeds directory.
Enjoy!