Missy MongoDB driver
MongoDB database driver for Missy.
Usage
Creating a Schema
Simple form:
var missy = ; var schema = 'mongodb://localhost/test' connect: // Native MongoClient options db: journal: true native_parser: true server: ssl: false logger: true ;
Full form with manual driver initialization:
var missy = mongodb = ; // Drivervar driver = { // Custom connecter function // A promise for a client return Q; // -> db}; // Schemavar schema = driver;
Type Handlers
The driver defines the following custom types:
'ObjectID'
: MongoDB ObjectID property.
var User = schema; User;
Tests
In order to run the tests, you need to define the 'MISSY_MONGODB` environment variable. The tests will work on the provided DB and clean-up the created collections afterwards:
$ MISSY_MONGODB="mongodb://localhost/test" npm test