UPDATE tablename update_expression [ KEYS IN primary_keys ] [ WHERE expression ] [ USING index ] [ RETURNS (NONE | ( ALL | UPDATED) (NEW | OLD)) ] [ THROTTLE throughput ]
UPDATE foobars SET foo = 'a'; UPDATE foobars SET foo = 'a', bar = bar + 4 WHERE id = 1 AND foo = 'b'; UPDATE foobars SET foo = if_not_exists(foo, 'a') RETURNS ALL NEW; UPDATE foobars SET foo = list_append(foo, 'a') WHERE size(foo) < 3; UPDATE foobars ADD foo 1, bar 4; UPDATE foobars ADD fooset (1, 2); UPDATE foobars REMOVE old_attribute; UPDATE foobars DELETE fooset (1, 2);
Update items in a table
- The name of the table
- Return the items that were operated on. Default is RETURNS NONE. See the Amazon docs for UpdateItem for more detail.
- Limit the amount of throughput this query can consume. This is a pair of
(read_throughput, write_throughput). You can use a flat number or a percentage (e.g.
*means no limit (typically useless unless you have set a default throttle in the Options).
All update syntax is pulled directly from the AWS docs:
In general, you may use any syntax mentioned in the docs, but you don’t need to
worry about reserved words or passing in data as variables like
will handle that for you.