$contains, offered only where the table stores the attribute in a form
contains applies to.
DynamoDB's contains tests a substring of a String, or membership of a List
or a Set. A String-stored attribute — including a date, an enum and a foreign
key — takes the substring reading; an array-typed field takes the membership
one. A number, a boolean and a Map take neither.
The two readings take different operands, which is why an array field gets
its own branch: a substring is a string, while an element is whatever the
list holds — including a Map, for a list of objects. Typing it as the element
is what lets the member test keep the field's own type instead of widening
to any scalar.
The element is written as AllowNullInWholeValue describes, which
offers null on its nullable fields: contains compares an element whole,
and the expression builder leaves a nulled field out of the bound element,
as the element is stored.
$contains, offered only where the table stores the attribute in a formcontainsapplies to.DynamoDB's
containstests a substring of a String, or membership of a List or a Set. A String-stored attribute — including a date, an enum and a foreign key — takes the substring reading; an array-typed field takes the membership one. A number, a boolean and a Map take neither.The two readings take different operands, which is why an array field gets its own branch: a substring is a string, while an element is whatever the list holds — including a Map, for a list of objects. Typing it as the element is what lets the member test keep the field's own type instead of widening to any scalar.
The element is written as AllowNullInWholeValue describes, which offers
nullon its nullable fields:containscompares an element whole, and the expression builder leaves a nulled field out of the bound element, as the element is stored.Distributes for the same reason BeginsWithConditionFor does.