hapi-mongodb-profiles
2.0.2 • Public • Published hapi-mongodb-profiles
Simple hapi plugin to manage mongodb connection profiles
Register plugin
server.pack.register({
plugin: require('hapi-mongodb-profiles'),
options: {
options: {
}
profiles: [
{ name: 'test', url: 'hapi://test/db', options: {
}}
]
}
}
Get database
server.plugins['hapi-mongodb-profiles'].db('profileName')
request.db('profileName')
request.db()
Get collection
server.plugins['hapi-mongodb-profiles'].collection('profileName', 'collectionName')
request.collection('test')
request.collection('profile', 'test')
Versions
Current Tags
- VersionDownloads (Last 7 Days)
- 2.0.2
2
Version History
Package Sidebar
Install
npm i hapi-mongodb-profiles
Weekly Downloads