@samiyev/mongo-comfortably

"# mongo-comfortably"


License
ISC
Install
npm install @samiyev/mongo-comfortably@2.7.9

Documentation

mongo-swift

Installation

$ npm install mongo-swift
$ 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 MongoSwift from 'mongo-swift';

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


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