Skip to content
This repository has been archived by the owner on May 28, 2024. It is now read-only.

tdegrunt/mongodb-fixtures

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Fixtures for mongodb

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published