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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.0.0
    10
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 2.0.0
    10
  • 1.0.2
    1
  • 1.0.1
    1
  • 1.0.0
    1

Package Sidebar

Install

npm i mangodb-client

Weekly Downloads

13

Version

2.0.0

License

SEE LICENSE IN LICENSE

Last publish

Collaborators

  • buzuli