Quickly populate your mongo db with .json files
If you ever wanted to quickly populate your mongo db with .json files in a node project, similar to how rails seed data works, it's now possible.
If you have a set of .json files with data for each collection just head on over to https://github.com/toymachiner62/node-mongo-seeds and follow the readme.
The way it works is that if you create a /seeds
folder in your project and put a file called users.json
in there, the library creates a mongo collection called users
and populates it with the json data in users.json
.
Written by Tom Caflisch
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Node
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#