Differences from Dynamo
Differences from Dynamo
Tynamo does not have to list every argument name used in an expression. This is because properties in Value Item (beginning with :
) or entity properties (beginning with #
) are automatically written down. Consider the following expression.
The above expression requires one entity property and two value property. Thus, Tynamo infers the following objects:
However, ExpressionAttributeValues
is an argument of AttributeMap
type, which violates Tynamo design principles. As an alternative, use the following value class:
Currently, one HASH
must be required in the ValueEntityClass also.
Attempting to use an argument that is not in the EntityClass
or ValueEntityClass
occurs error.
Custom EntityPropertyName
It is also possible to set an alias for the EntityProperty. If you want to use the name #identifier
instead of id
, you can pass it explicitly in ExpressionAttrubuteNames
.
Inferences made by Tynamo may conflict with what you explicitly conveyed. In this case, use the one passed explicitly.
Although a name
exists in the entity, it is used as aslias of id
.
Skip unnecessary elements
Dynamo raises an error if there is a declared but unused value name. Tynamo finds these elements and helps them to be omitted at the time of the actual call. For example,
In the expression above, #unused
, :a
, and :b
are declared but not used. Dynamo raises an error if there is such an element, but Tynamo sends only the element that is actually used so no error occurs. It is good for DynamicExpression
.
Example
The above putItem
opreration is always fails because :a < :b
is false.
Last updated