New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

koa-mongo-db

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

koa-mongo-db

Get db connection in context

  • 3.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-81.82%
Maintainers
1
Weekly downloads
 
Created
Source

koa-mongo-db

Get db connection in context

Install

$ npm install --save koa-mongo-db

Usage

use version 1 for koa 1

var app = require('koa')();

var koaMongoDb = require('koa-mongo-db');
app.use(koaMongoDb('mongodb://localhost/test'));

app.get('/', function * (next) {
	this.db // => Db object
});

API

koaMongoDb(uri, [options])

uri

Required
Type: string

Connection string uri.

options

All options from MongoClient are accepted as well.

property

Type: String
Default: db

Property on request object in which db connection will be stored.

License

MIT

Thanks to floatdrop for the original express-mongo-db.

Keywords

FAQs

Package last updated on 04 Nov 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc