drudge / mongoose-timestamp

Adds createdAt and updatedAt date attributes that get auto-assigned to the most recent create/update timestamp
Other
308 stars 64 forks source link

Virtual `createdAt` not available on document.toJSON #41

Open Koka5 opened 7 years ago

Koka5 commented 7 years ago

In earlier version 0.1.1 i was not specifying any createdAt in my schema file. mongoose-timestamp used to add and and setupvirtuals

Now mongoose-timestamp is adding virtuals only if i have explicitly defined the createdAt field.