This package has been deprecated

Author message:

reason

@samiyev/mongo-comfortably
TypeScript icon, indicating that this package has built-in type declarations

2.7.9 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i @samiyev/mongo-comfortably

Weekly Downloads

2

Version

2.7.9

License

ISC

Unpacked Size

39.9 kB

Total Files

19

Last publish

Collaborators

  • npm