Inspired from Django's data-fixtures and Ruby's rake but built for nodejs. Mongoose-Fixture is a command-line and utility library to load static json arrays/documents into mongodb. Ideal for working with the MEAN stack.
Installing Mongodb will give access to the mongoimport
command, however that is for simple importing and not flexible as a workflow-tool.
Mongoose-Fixture comes with the following features to improve developer workflow
There were api adjustments moving from version 0.2.x to 0.3.0, specifically within your data-fixtures. In order to support the new 0.3.0 release you need to adjust the method signature in all your data fixtures.
// 0.2.x data fixture method signature
module.exports = function(mongoose, callback){
// function body
};
// new 0.3.0 data fixture method signature
module.exports = function(mongoose, conn, callback){
// function body
};
Read the documentation guide for a full-walkthrough and sample project