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
Did you know?
JavaScript on a page runs with the privileges of that origin. One altered library, tag manager, or snippet can read inputs, change what people see, and call your APIs as the user.
Security insights from Cside
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#