mangodb-client

2.0.0 • Public • Published

mangodb-client

Build Status NPM version

A powerful MangoDB client for Node.js

Most users just want to get started quickly without getting weighed down by features. The mangodb-client brings a whole new level of simplicity. Happy sharting!

Installation

npm install --save mangodb-client

Usage

// Node auto-discovery. Or use any config format of your own invention!
const db = require('mangodb-client')();
 
// Write something (guaranteed consistency)
db.put('key', 'value', error => {
    if (error) {
      // Not even worried
    } else {
      console.log('cool')
    }
});
 
// And with Promises
db.put('key', 'value').then(() => console.log('yep'));
 
 
 
// Read something (predictive result, which will self-correct
// if the server sends a more accurate response).
db.get('key', (error, {key, value}) => {
  if (error) {
    // Still not worried
  } else {
    console.log(`Got ${value} at ${key}`)
  }
});
 
// And with Promises
db.get('key').then(({key, value}) => console.log(`Got ${value} at ${key}`));

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i mangodb-client

      Weekly Downloads

      2

      Version

      2.0.0

      License

      SEE LICENSE IN LICENSE

      Last publish

      Collaborators

      • buzuli