Skip to content

Instantly share code, notes, and snippets.

@supun19
Created May 7, 2018 14:15
Show Gist options
  • Save supun19/caca2461c531ce58aaced7f6ff7c92c0 to your computer and use it in GitHub Desktop.
Save supun19/caca2461c531ce58aaced7f6ff7c92c0 to your computer and use it in GitHub Desktop.
function getItem(){
const params = {
TableName: "",
Key:{
id: ""
},
ProjectionExpression:"#role",
ExpressionAttributeNames:{
'#role':'role'
}
};
return new Promise((resolve, reject)=>{
dynamodb.get(params, (error, result) => {
if (error) {
reject(err);
}
else {
resolve(result)
}
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment