Nullable
Define nullable property
@DynamoEntity()
class Cat {
@DynamoProperty({ keyType: KeyType.hash })
id!: number;
@DynamoProperty({ keyType: KeyType.sort })
age!: number;
@DynamoProperty({
keyType: KeyType.attr,
nullable: true // <<<
})
name?: string;
constructor(id: number, age: number, name?: string) {
this.id = id;
this.age = age;
this.name = name;
}
}Last updated