Dynamoose is a modeling tool for Amazon's DynamoDB (inspired by Mongoose)
$ npm i dynamoose
Set AWS configurations in environment variables:
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:
const dynamoose = require('dynamoose');
// Create cat model with default options
const Cat = dynamoose.model('Cat', {
id: Number,
name: String
});
// Create a new cat object
const garfield = new Cat({
id: 666,
name: 'Garfield'
});
// Save to DynamoDB
garfield.save(); // Returns a promise that resolves when save has completed
// Lookup in DynamoDB
Cat.get(666).then((badCat) => {
console.log(`Never trust a smiling cat. - ${badCat.name}`);
});
The documentation can be found at https://dynamoosejs.com/api/about/. You can also find additional examples at https://dynamoosejs.com/examples/about/.
The Dynamoose Changelog can be found in the CHANGELOG.md file.
The Dynamoose Roadmap can be found in the ROADMAP.md file. Help is always appreciated on these items. If you are able to help submit a PR so we can review and improve Dynamoose!
To contirubute to this project please checkout our CONTRIBUTING.md file.