mgan59 / mongoose-fixture

A bootstrap library to import javascript objects into mongodb using a series of raw json files
25 stars 3 forks source link

Mongoose-Fixture

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.

Why would I use it?

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

Migrating to Release 0.3.0

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
};

Getting Started

Read the documentation guide for a full-walkthrough and sample project

New Development / Contribution

Bitdeli Badge