servel333 / vogels-promisified

DynamoDB library Vogels promisified

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

vogels-promisified

DynamoDB library Vogels promisified for use with Bluebird

A drop-in replacement that extends Vogels with Async methods.

Usage

const vogels = require("vogels-promisified");

Example

var User = module.exports = vogels.define("User", {
  hashKey : "email",

  timestamps : true,

  schema : {
    _id : vogels.types.uuid(),
    email : Joi.string().email(),
  },
});

User
  .getAsync(email)
  .then(function(user){
    // ...
  })
  .catch(function(err){
    // ...
  });

User
  .scan()
  .where("_id").equals(userId)
  .execAsync()
  .then(function(user){
    // ...
  })
  .catch(function(err){
    // ...
  });

About

DynamoDB library Vogels promisified

License:Other


Languages

Language:JavaScript 100.0%