It looks like the built in LoopBack models are baked with "create/modified" date fields. Is there an easy way to add this to "generated" models? I've been looking through the docs but can't find anything in the model docs- http://docs.strongloop.com/display/public/LB/Defining+models
Any suggestions?
A LoopBack model is a JavaScript object with both Node and REST APIs that represents data in backend systems such as databases. Models are connected to backend systems via data sources. You use the model APIs to interact with the data source to which it is attached.
I'm pretty sure this is what you are looking for: https://github.com/clarkbw/loopback-ds-timestamp-mixin
There is no built-in way ATM. I suggest using an operation hook mixed with new Date()
. See http://docs.strongloop.com/display/public/LB/Operation+hooks#Operationhooks-beforesave.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With