diff options
| author | Kumar Damani <kumar.damani@mail.utoronto.ca> | 2019-04-16 13:17:06 +0000 |
|---|---|---|
| committer | Kumar Damani <kumar.damani@mail.utoronto.ca> | 2019-04-16 13:17:06 +0000 |
| commit | dc46b87abee1e441c07524ddde67fd902a919336 (patch) | |
| tree | 13eba08b8655dfd78e9600ec5f612011a0bf3b35 /node_modules/mongo-factory/README.md | |
| parent | 26f4b38e9e5a202756a7c33abc775aea2617aeaf (diff) | |
added some dependencies to package.json
Diffstat (limited to 'node_modules/mongo-factory/README.md')
| -rw-r--r-- | node_modules/mongo-factory/README.md | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/node_modules/mongo-factory/README.md b/node_modules/mongo-factory/README.md deleted file mode 100644 index 81433b5..0000000 --- a/node_modules/mongo-factory/README.md +++ /dev/null @@ -1,43 +0,0 @@ -#mongo-factory -[](https://travis-ci.org/toymachiner62/mongo-factory) -[](https://codeclimate.com/github/toymachiner62/mongo-factory) - -> The purpose of this module is to manage mongo connection pools without creating a new connection pool in every file. -> -> You can require this module in as many files as you want and every time you call `mongoFactory.getConnection` it returns -> a connection if one exists for the connection string passed in, or it instantiates the connection pool and -> then returns a connection. - -## Usage - -```js -var mongoFactory = require('mongo-factory'); - -mongoFactory.getConnection('mongodb://localhost:27017') - .then(function(db) { - // Use mongo's "db" object as you normally would. - db.collection.find()... - }) - .catch(function(err) { - console.error(err); - }); -``` - -## API - -#### `getConnection(mongodbConnectionString)` - -The only parameter is a connection string for a MongoDB connection. - -#### `ObjectId` - -Exposes the MongoDB [ObjectID](http://mongodb.github.io/node-mongodb-native/2.0/tutorials/objectid/) function. - -## Contributing - -1. Clone project and run `npm install` -2. Add feature(s) -3. Add tests for it -4. Submit pull request - -Enjoy! |
