Shouldn't properties without the @Attributes decorator be left out? #205
-
Hi! just wanted to clarify, in an entity like the one in the docs: export class User {
@Attribute()
name: string;
updatedAt: string
} both |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
This is expected behavior, as So at the time of instantiating a model, if the model does not contain a value for a property it will not be added to the dynamo. In addition to this, there is also a |
Beta Was this translation helpful? Give feedback.
This is expected behavior, as
@Attribute
is just a decorator to allow us to configure TypeDORM-specific metadata for that property.It does not and will not stop an attribute from going into DynamoDB if it was passed in as part of the model value.
So at the time of instantiating a model, if the model does not contain a value for a property it will not be added to the dynamo.
In addition to this, there is also a
hidden
option that the@Attribute
decorator supports, which might also be something that can help you.Please look at the api.