Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

app-context-access-mongo

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

app-context-access-mongo

access-mongo initializer for app-context

  • 0.3.0
  • latest
  • Source
  • npm
  • Socket score

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

app-context-access-mongo

access-mongo initializer for app-context

Installation

$ npm install --save app-context-access-mongo

Usage

var AppContext = require('app-context');
var accessMongo = require('app-context-access-mongo');

module.exports = AppContext.createContext({
  configure: function() {
    this.use(
      AppContext.RunLevel.Connected,
      // load the mongodb URL from your APP.config.mongodb
      accessMongo('mongodb')

      // load 2 connections and assign them to the default connection and the users connection
      accessMongo({
        default: 'mongodb://localhost/main',
        users: 'mongodb://foo:bar@localhost/users'
      })
    );

    // you can optionally use app-context-access-mongo through app-context-initialize
    // to create connections from APP.config.mongodb.centralDB and APP.config.mongodb.users
    var initialize = require('app-context-initialize');
    this.use(
      AppContext.RunLevel.Connected,
      initialize({
        'access-mongo': {
          default: '$mongodb.centralDB',
          users: '$mongodb.users'
        }
      })
    );
  }
});

Keywords

FAQs

Package last updated on 14 Feb 2017

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