Skip to content

Standardized patterns for working with DynamoDB

Notifications You must be signed in to change notification settings

usefulio/dynamodb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Standardized patterns for working with DynamoDB

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published