miffo
Wrapper for the mongodb native driver in node.js. Trying to stay as close as possible to the shell API.
Features
- Use as a simple wrapper or with konstapel for authentication middleware.
- Uses bcrypt to hash passwords.
- See the mongodb docs for a complete syntax.
Install
$ npm install miffo
Usage
var Miffo = url = 'mongodb://user:pwd@url:port/db' collections = 'users' 'items' db = url collections; // connectdbstart<cb>; // logs on success and throws otherwise. Pass cb to do async. // wrapper APIdbcollectionName; // Methodsdb // new mongo-style ObjectIDdb // ObjectID from stringoid // hex from ObjectIDdbbcrypthash // hash pwd (See bcrypt for details)dbbcrypt // compare pwds // closedbconnection; // the return object from mongo.connect is stored on db.connection
Test
# All tests pass. Needs auth data from settings.json for query operations.
$ npm test
Licence
MIT