'How to delete a String element from String Set in DynamoDB using Node JS?
My table
I am trying to delete one string element "Nike" from existing StringSet in Dynamodb table name stacks. I executed:
var params={
TableName:"stacks",
Key:{
Overflow:1
},
UpdateExpression:" DELETE LikeByUser :b ",
ExpressionAttributeValues:{
":b":dynamodb.createSet("Nike")
},
ReturnValues: "ALL_NEW"
}
dynamodb.update(params, function(err, data) {
if (err) {
console.log("Error", err);
} else {
console.log("Updated Successfully ");
console.log(JSON.stringify(data, null, 2));
}
});
But got Error
ValidationException: An operand in the update expression has an incorrect data type.
I tried REMOVE in place of DELETE but no show even then.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

