Expressions (conditions, update)
For conditions and updates, DynamoDB uses expression statements. We provide functions to build those expressions either in a strictly or a non-typed way.
Last updated
For conditions and updates, DynamoDB uses expression statements. We provide functions to build those expressions either in a strictly or a non-typed way.
Last updated
Condition Expressions are used for two purposes:
pre condition for write operations (delete, put, update) onlyIf()
,onlyIfAttribute()
filter condition for read operations (query, scan ) where()
,whereAttribute()
onlyIfAttribute()
and whereAttribute()
provide a chainable way to add your conditions, all conditions are combined with and
operator:
to either use not
or or
operator you need to use the onlyIf()
resp. where()
methods:
For better typings the attribute2
function is provided (only useful for top level properties)
The same methods also exists for all transact operations (used in TransactWriteRequest
)
As for condition expressions, there are two ways to define the update expressions for an update request:
the chainable way:
the not-that-chainy way:
the
operations
method primarily exists for more flexibility
There also exists the update2(ModelClazz, propertyName)
function as equivalent to attribute2()
for better typing.
The same methods also exists for TransactUpdate
(used in TransactWriteRequest
)