Fixtures for mongodb
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
examples Fixes issue #1 Jan 19, 2012
fixtures
README.md
mongodb-fixtures.js
package.json Feature: Use coffee-script templating in the fixtures Oct 26, 2011

README.md

mongodb-fixtures

Easy fixtures for mongodb:

1) Put a fixtures folder in your project

2) Put JSON files in the fixtures folder, with the filenames being the collection-names (plural)

3) Create code similar to:

var fixtures = require('mongodb-fixtures');

var Db = require('mongodb').Db,
  Connection = require('mongodb').Connection,
  Server = require('mongodb').Server;

var db = new Db('wines', new Server("localhost", Connection.DEFAULT_PORT, {}));

fixtures.load();
fixtures.save(db, function() {
  db.close();
  console.dir(fixtures);
});