enormis

0.3.2 • Public • Published

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;
}

Readme

Keywords

Package Sidebar

Install

npm i enormis

Weekly Downloads

0

Version

0.3.2

License

Apache-2.0

Last publish

Collaborators

  • iddan