Skip to content

Good practice for lastModified timestamp / hooks in general?  #52

@thokari

Description

@thokari

Hi again!
I wanted to quickly ask, if there is a recommended way to set both 'createdAt' timestamp and 'updatedAt' timestamp. The 'created' one could be defined in the model as having a default value of 'new Date()', but how about the 'updatedAt' one?
I was just evaluating waterline, and came across this feature, which I found pretty nice:
https://github.com/balderdashy/waterline-docs/blob/master/models.md#autocreatedat

Related question:
Are there any hooks, like 'beforeSave' or similar, that could be used for that purpose?
Excuse me if that should be covered by Backbone knowledge I do not yet have ;)

Again, thanks for your help, it is very much appreciated!
Thomas

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions