Socket
Socket
Sign inDemoInstall

@samiyev/mongo-comfortably

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@samiyev/mongo-comfortably

"# mongo-comfortably"


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

mongo-comfortably

Installation

$ npm install @samiyev/mongo-comfortably
$ pushd c:
$ cd c/Program Files/MongoDB/Server/3.2/bin
$ mongod --dbpath db

08-03-2017 17-27-17

08-03-2017 17-43-30

Usage

import * as Mongo from '@samiyev/mongo-comfortably';

var options = {
    databases: [
        'local',
        'network',
        'offline',
        'others',
        'admin',
        'online'
    ]
};

const db = new Mongo(options);

setTimeout(async() => {
    try {
        var users = await db.online.users.count();
        var messages = await db.online.messages.count();
        var commints = await db.online.commints.count();
        var pictures = await db.online.pictures.count();
        var posts = await db.online.posts.count();
        var statuses = await db.online.statuses.count();

        var oneUser = await db.online.users.findOne({});
        var allUsers = await db.online.users.find({}).toArray();

        console.log("Results => ",
            "\nUsers count =>", users,
            "\nMessages count =>", messages,
            "\nCommints count =>", commints,
            "\nPictures count =>", pictures,
            "\nPosts count =>", posts,
            "\nStatuses count =>", statuses,
            "\nAll users count =>\n", allUsers,
            "\none user =>\n", oneUser
        );
    }
    catch (error){
        console.log("Error => ", error);
    }
}, 5000);

Results

09-03-2017 16-43-27

FAQs

Package last updated on 09 Apr 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