An open API service indexing awesome lists of open source software.

https://github.com/framingeinstein/node-mongo-provider

A Simple MongoDB Node.JS wrapper
https://github.com/framingeinstein/node-mongo-provider

Last synced: 3 months ago
JSON representation

A Simple MongoDB Node.JS wrapper

Awesome Lists containing this project

README

          

mongo-provider - A simple wrapper for mongodb driver for NodeJS
====================
[![Build Status](https://secure.travis-ci.org/framingeinstein/node-mongo-provider.png)](http://travis-ci.org/framingeinstein/node-mongo-provider)

Installation
------------
You can install this through npm: npm install mongo-provider

You can also install via git by cloning: `git clone https://github.com/framingeinstein/node-mongo-provider.git /path/to/mongo-provider`

Usage
-----

var MongoProvider = require('mongo-provider').MongoProvider;
var myCollectionProvider = new MongoProvider('server', port, 'MyDatabase', 'MyCollection');
provider.on("open", function (err, client) {
// Do something with client


// Don't forget to destroy the provider to cleanup and close the connection
provider.destroy(function (err, client) {
//Do something when destroyed
});
});