A filter or condition expression. This type
serves as the root of a object structure for specifying a
filter/condition expression which is translated to a DynamoDB
Conditional expression for use with some of the available
operations (in their underlying ConditionExpression or
FilterExpression fields.
The syntax is very similar to Mongo's query syntax, but a little
bit stricter to help with type evaluation.
A simple condition expression consists of key paths mapped to an operator.
For example, to test profile.username = 'test@example.com', you would
construct an expression as follows:
This expression would be translated to DynamoDB's FilterExpression syntax as:
#attr0.username = :value0
(profile is a reserved word in DynamoDB and automatically mapped. #attr0 and :value0 will be
written to ExpressionAttributeNames and ExpressionAttributeValues
respectively for you).
Multiple key paths in the same object are treated as an AND operation implicitly.
NOTE: For a full list of key path operators, see the [[KeyPathsAndClause]] type.
You can also construct AND, OR and NOT expressions for more complex evaluations, e.g.:
A filter or condition expression. This type serves as the root of a object structure for specifying a filter/condition expression which is translated to a DynamoDB Conditional expression for use with some of the available operations (in their underlying
ConditionExpression
orFilterExpression
fields.The syntax is very similar to Mongo's query syntax, but a little bit stricter to help with type evaluation.
A simple condition expression consists of key paths mapped to an operator. For example, to test
profile.username = 'test@example.com'
, you would construct an expression as follows:This expression would be translated to DynamoDB's FilterExpression syntax as:
#attr0.username = :value0
(
profile
is a reserved word in DynamoDB and automatically mapped.#attr0
and:value0
will be written toExpressionAttributeNames
andExpressionAttributeValues
respectively for you).Multiple key paths in the same object are treated as an
AND
operation implicitly.You can also construct AND, OR and NOT expressions for more complex evaluations, e.g.:
This would be written in DynamoDB's FilterExpression syntax as:
(NOT #attr0.#attr1 <= :value0) OR (#attr0.point.x > :value1 AND #attr0.point.y < :value2)
where:
#attr0
is mapped to 'location' (reserved word)#attr1
is mapped to 'value' (reserved word):value0
is mapped to0
(Expression Attribute Value):value1
is mapped to10
(Expression Attribute Value):value2
is mapped to1.3
(Expression Attribute Value)