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

@dekproject/mongodb

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dekproject/mongodb

MongoDB interface plugin for DEK

  • 1.2.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
Maintainers
1
Weekly downloads
 
Created
Source

@dekproject/mongodb

MongoDB interface plugin for DEK

What does this plugin do?

  • Control configuration for connection to MongoDB in production development mode in a simplified way with dotenv
  • Performs connection implementation along the lines ES6 being pre requirement to start the project

Instalation

To install the bootstrap we recommend using the CLI

$ yarn add @dekproject/mongodb --save
$ nano .env

In the .env file add the following settings

MONGO_USER=
MONGO_PASSWORD=
MONGO_HOST=localhost
MONGO_PORT=27017
MONGO_DB=dek

For applications with cluster usage in MongoDB

MONGO_USER=
MONGO_PASSWORD=
MONGO_PATH=mongodb://mongo-01:27017,mongo-02:27017/dek?replicaSet=dek&readPreference=secondaryPreferred
MONGO_DB=dek

Usage

Using direct

$ npm i @dekproject/scope

Using in the standard DEK skeleton

import { $, app, mongodb } from "@dekproject/scope";

app.get("user", (req, res) => {
    mongodb.users.find({}).toArray((err, docs) => {
        if(err) res.status(500).send(err).end();
        else res.send(docs).end();
    });
});

$.wait("mongodb").then(() => {
    app.listen(PORT, () => {
        console.log(`App listening on port ${PORT}!`);
    });
});

Keywords

FAQs

Package last updated on 13 Jul 2019

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