An abstraction layer for mongodb providing events and utility methods.
Install the module:
npm install MongoInstance
Require the module:
var MongoInstance = require('MongoInstance');
Instantiate the module with a mongodb connection string and optionally autoSetup and autoConfigure
var mongo = new MongoInstance({
url: "mongodb://[user:pass@]hostname:port/db?options",
noAutoSetup: false,
noAutoConnect: false,
});
The module effectively provides a platform with events and generic methods for interacting with a mongo database.
Events are published using node's event emitter.
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
Copyright (c) 2014 Lawrence Goldstien Licensed under the MIT license.