What is the best method to seeding a Node / MongoDB application?
What is the best method to seeding a Node / MongoDB application? So, I'm new to the MEAN stack, and I've hit a wall trying to seed MongoDB. I'm using Mongoose to communicate with the database, and there's a bunch of documentation suggesting I should be able to seed using populated JSON files. What I've tried: node-mongo-seed ; Pretty straight forward, but consistently throws errors on the end of arrays. (Perhaps the missing bson module is at fault?) { [Error: Cannot find module '../build/Release/bson'] code: 'MODULE_NOT_FOUND' } js-bson: Failed to load c++ bson extension, using pure JS version Seeding files from directory /Users/Antwisted/code/wdi/MEAN/seeds ---------------------- Seeding collection locations err = [SyntaxError: /Users/Antwisted/code/wdi/MEAN/seeds/locations.json: Unexpected token {] mongoose-seed ; Also pretty straight forward, basically puts the JSON objects into a variable before exporting to the database. Promising, but... more ...
