Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/onebeyond/systemic-mongodb
A systemic mongodb component
https://github.com/onebeyond/systemic-mongodb
Last synced: about 2 months ago
JSON representation
A systemic mongodb component
- Host: GitHub
- URL: https://github.com/onebeyond/systemic-mongodb
- Owner: onebeyond
- License: mit
- Created: 2016-07-13T23:15:04.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2023-07-20T11:47:52.000Z (about 1 year ago)
- Last Synced: 2024-07-13T12:47:22.613Z (2 months ago)
- Language: JavaScript
- Size: 243 KB
- Stars: 1
- Watchers: 14
- Forks: 4
- Open Issues: 26
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Maintainability](https://api.codeclimate.com/v1/badges/88bb5737814cba7db3e5/maintainability)](https://codeclimate.com/github/onebeyond/systemic-mongodb/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/88bb5737814cba7db3e5/test_coverage)](https://codeclimate.com/github/onebeyond/systemic-mongodb/test_coverage)# systemic-mongodb
A [systemic](https://github.com/guidesmiths/systemic) mongodb component## Usage
```js
const System = require('systemic')
const mongodb = require('systemic-mongodb')new System()
.configure({
mongodb: {
url: 'mongodb://127.0.0.1/example',
options: {
server: {
poolSize: 5
}
},
showConnectionString: false
}
})
.add('logger', console)
.add('mongodb', mongodb()).dependsOn('config', 'logger')
.start((err, components) => {
// Do stuff with components.mongodb
})
```### Parameters
- **url** Use *mongodb://* [connection string](https://docs.mongodb.com/manual/reference/connection-string/)
- **showConnectionString** Show connection string on logs, **false** by default
- **options** Options passed to [MongoClient](https://mongodb.github.io/node-mongodb-native/api-generated/mongoclient.html)