Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CreatedAt/updatedAt #17

Open
MarioArnt opened this issue Apr 10, 2020 · 0 comments
Open

CreatedAt/updatedAt #17

MarioArnt opened this issue Apr 10, 2020 · 0 comments
Labels

Comments

@MarioArnt
Copy link
Contributor

MarioArnt commented Apr 10, 2020

It would be useful to have automatically generated fields createdAt and updatedAt that are kept up to date when entities are updated.

class MyModel extends Model<unknown> {
   autoCreatedAt = true; // false in super class
   autoUpdatedAt = true; // false in super class
}

The createdAt is set at the initial creation and remains unchanged. It is set only when using DocumentClient.create method. And the validity of the field is not maintained by dynamodels on DocumentClient.save.

Please make sure to update the updatedAt during subsequent calls to the DocumentClient.update and DocumentClient.save methods.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant