osmos-contrib-mongodb
v1.0.0
Published
Mongodb driver for Osmos
Downloads
10
Readme
osmos-contrib-mongodb
mongodb Driver for osmos-lite.
This Driver is the split out version from the 1.x version of Osmos.
Usage
This package will work for [email protected]. (As currently osmos-lite is in beta, you will have to install directly from github)
npm install mongodb --save
npm install git://github.com/limianwang/osmos-lite#2.x --save
npm install osmos-contrib-mongodb --save
var osmos = require('osmos-lite');
var Driver = require('osmos-contrib-mongodb');
var mongodb = require('mongodb');
mongodb.MongoClient.connect(url, options, function(err, db) {
if(err) {
return done(err);
}
var driver = new osmosMongo(db);
osmos.drivers.register('mongodb', driver);
model = new Model('TestMongo', schema, 'name', 'mongodb');
model.create(...)
});