The class type that the decorator is applied to, ensuring type safety and integration within specific class instances.
A type constraint extending Date
, ensuring that the decorator is only applied to class fields specifically intended to represent dates.
Optional
props: AttributeOptionsAn AttributeOptions object providing configuration options for the attribute, such as its alias
which allows the attribute to be referred to by an alternative name in the database context. The nullable
property is also set to true
by default, indicating that the date attribute can be empty.
A class field decorator function that operates within the class field's context. It configures the field as a date attribute and defines how it should be serialized and deserialized to/from DynamoDB.
Usage example:
class MyEntity extends MyTable {
@NullableAttribute({ alias: 'MyField' })
public myField?: string; // Set to Optional
}
Here, @Attribute
decorates myField
of MyEntity
, marking it as an entity attribute with an alias 'MyField' for ORM purposes.
Generated using TypeDoc
Similar to '@Attribute' but specific to Dates since Dates are not native types to dynamo
IMPORTANT - For optimal type safety mark the class field property as optional