Meet npm Pro: unlimited public & private packages + package-based permissions.Learn more »

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

Install

npm i mangodb-client

DownloadsWeekly Downloads

12

Version

2.0.0

License

SEE LICENSE IN LICENSE

Last publish

Collaborators

  • avatar