Skip to content
/ eymon Public

eymon: es6 classes promisifying communication with mongodb

License

Notifications You must be signed in to change notification settings

tadalabs/eymon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

eymon

es6 classes promisifying communication with mongodb

NPM version

usage

details

StorageService currently supports:

  • create
  • read
  • update, updateInto, updateMany, updateManyInto
  • delete, deleteMany

examples

create my favorite color document

import eymon from 'eymon';
const service = new eymon.StorageService("playa");

service.create('color', {
    type: 'favorite',
    value: 'blue'
});

read my favorite color document

import eymon from 'eymon';
const service = new eymon.StorageService("playa");

service.read('color', {type: 'favorite'})
    .then( (resultSet) => {
        console.log(resultSet);
    })
    .catch( (error) => {
        console.log('error: ', error);
    });