npm.io
0.3.2 • Published 8 years ago

enormis

Licence
Apache-2.0
Version
0.3.2
Deps
2
Vulns
0
Weekly
0
Stars
1

Enormis

Simple modern MongoDB driver

Use MongoDB like this:

const { Client } = require('enormis')

async function getUsers() {
    const client = await Client('mongodb://localhost:27017');
    const users = await client.test.user.find({});
    client.close();
    return users;
}

Instead of:

const { MongoClient } = require('mongodb')

async function getUsers() {
    const client = await MongoClient.connect('mongodb://localhost:27017');
    const users = await client.db('test').collection('user').find({}).toArray();
    client.close();
    return users;
}

Keywords