Skip to content

How to add and delete from a set type? #390

Answered by raryanpur
meightythree asked this question in Q&A
Discussion options

You must be logged in to vote

Sure, you should be able to use the add and delete operations on the patch and update mutations (docs here and here). These resolve to using the UPDATE expression in Dynamo under the hood, so don't require you to read-modify-write in client code or use read capacity units.

For example,

await ConnectionEntity.patch({userId}).delete({connectionIds: [<ids_to_remove>]})

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by meightythree
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants