Skip to content

A tool to quickly populate your mongo db from a set of .json files

License

Notifications You must be signed in to change notification settings

nthurow/node-mongo-seeds

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-mongo-seeds

A tool to quickly populate your mongo db from a set of .json files

Usage

  • 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 /seeds folder in your project root and put .json files 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 seed to seed your mongodb with all your data from your /seeds folder.

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!

About

A tool to quickly populate your mongo db from a set of .json files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published