Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mgan59/mongoose-fixture
A bootstrap library to import javascript objects into mongodb using a series of raw json files
https://github.com/mgan59/mongoose-fixture
Last synced: about 1 month ago
JSON representation
A bootstrap library to import javascript objects into mongodb using a series of raw json files
- Host: GitHub
- URL: https://github.com/mgan59/mongoose-fixture
- Owner: mgan59
- Created: 2013-03-14T02:37:28.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-04-07T18:57:14.000Z (over 10 years ago)
- Last Synced: 2024-09-30T11:02:53.933Z (about 2 months ago)
- Language: JavaScript
- Size: 1.26 MB
- Stars: 25
- Watchers: 3
- Forks: 3
- Open Issues: 10
-
Metadata Files:
- Readme: readme.md
- Changelog: changelog.md
Awesome Lists containing this project
README
# 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](http://blog.mongodb.org/post/49262866911/the-mean-stack-mongodb-expressjs-angularjs-and) 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
* Project Configuration, organize documents collections into sets, for custom batch executions
* BoilerPlates, generate Schemas/Fixtures to reduce typing
* API can be used within other processes, a nodejs event-emitter# 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](http://mgan59.github.io/mongoose-fixture/) for a full-walkthrough and [sample project](https://github.com/mgan59/mongoose-fixture-example/)
# New Development / Contribution
* more tests
* create a grunt hook, consider supporting own bin command?
* more documentation (specifically examples)[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/mgan59/mongoose-fixture/trend.png)](https://bitdeli.com/free "Bitdeli Badge")