Dynamoose is a modeling tool for Amazon's DynamoDB (inspired by Mongoose)
$ npm install dynamoose
Set AWS configurations in enviroment varable:
export AWS_ACCESS_KEY_ID="Your AWS Access Key ID"
export AWS_SECRET_ACCESS_KEY="Your AWS Secret Access Key"
export AWS_REGION="us-east-1"
Here's a simple example:
var dynamoose = require('dynamoose');
// Create cat model with default options
var Cat = dynamoose.model('Cat', { id: Number, name: String });
// Create a new cat object
var garfield = new Cat({id: 666, name: 'Garfield'});
// Save to DynamoDB
garfield.save();
// Lookup in DynamoDB
Cat.get(666)
.then(function (badCat) {
console.log('Never trust a smiling cat. - ' + badCat.name);
});
The documentation can be found at https://dynamoosejs.com/api.