Skip to content
This repository has been archived by the owner on Apr 20, 2022. It is now read-only.

servel333/vogels-promisified

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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){
    // ...
  });