Open molinto opened 9 years ago
Hey, thanks :-)
Hmm it may a good improvement. It wouldn't be hard. It would just not override the created field if it's already filled with a value. However it's very important to make it secure. Let's imagine a situation when you're sending a document from the client to the server with the created field already filled by the user on the client. So it should be optional feature.
For now you can just create this field by your self and fill out with a value. You can turn off the createdAt field in behaviors option by setting the hasCreatedField
option to false
.
Thanks, I've done just that for the time being :+1:
Ok good
Hi, thanks for all your hard work with the great astronomy packages!
I'm trying to seed the database with content. Is there a way to overwrite the created value on save()? Eg, populate the value of the created rather than using the behaviour timestamp when its not defined in the controller. Please see below
Model
Controller
Thanks Sharry
PS - Works OK with Node & Mongoose with this package: https://github.com/drudge/mongoose-timestamp