@useful/dynamodb
v1.0.8
Published
Standardized patterns for working with DynamoDB
Downloads
4
Keywords
Readme
Put an Item to DynamoDB
const put = require('@useful/dynamodb').put;
put('my-ddb-table', objectIWantStored); // returns a promise
Get an Item from DynamoDB
const get = require('@useful/dynamodb').get;
get('my-ddb-table', { YourHashKeyName: "YourItemsHashKeyValue" }); // returns a promise
Delete an Item from DynamoDB
const remove = require('@useful/dynamodb').remove;
remove('my-ddb-table', { YourHashKeyName: "YourItemsHashKeyValue" }); // returns a promise
Update an Item in DynamoDB
const update = require('@useful/dynamodb').update;
update('my-ddb-table', { YourHashKeyName: "YourItemsHashKeyValue" }, { /* Your update expression */ }, { /* Your expression attribute values */ }, /* ReturnValues string */ ); // returns a promise
Query a DynamoDB
const query = require('@useful/dynamodb').query;
var params = {
TableName : "Movies",
KeyConditionExpression: "#yr = :yyyy",
ExpressionAttributeNames:{
"#yr": "year"
},
ExpressionAttributeValues: {
":yyyy":1985
}
};
query(params); // returns a promise