You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! Thanks for the library! I've a question: Is it possible to update an item stored in the dynamoDB table incrementing a value without read it, update the value and finally write again.
Using the aws-sdk you can do something like it: dynamoDB.updateItem({ TableName: "Users", Key: { "UserId": { S: "c6af9ac6-7b61" } }, ExpressionAttributeValues: { ":inc": {N: "1"} }, UpdateExpression: "ADD loginCount :inc" })
Thanks!
The text was updated successfully, but these errors were encountered:
You can use update query to increment attribute value:
(To decrement value, Simply supply negative value)
// for HashPrimaryKey based Table
Table.primaryKey.update(hashKey, { attr: ["ADD", 1] }); // equivalent to "ADD attr 1"
// for FullPrimaryKey based Table
Table.primaryKey.update(hashKey, rangeKey, { attr: ["ADD", 1] }); // equivalent to "ADD attr 1"
FYI, All of maintainers of dynamo-types left Vingle, Inc. (which is owner of this repository.) Unfortunately, We couldn't get permissions from Company - We lost all permissions about this repository (including access credentials for accessing NPM).
Hi! Thanks for the library! I've a question: Is it possible to update an item stored in the dynamoDB table incrementing a value without read it, update the value and finally write again.
Using the aws-sdk you can do something like it:
dynamoDB.updateItem({ TableName: "Users", Key: { "UserId": { S: "c6af9ac6-7b61" } }, ExpressionAttributeValues: { ":inc": {N: "1"} }, UpdateExpression: "ADD loginCount :inc" })
Thanks!
The text was updated successfully, but these errors were encountered: