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

Select createdAt and updatedAt by default #24

Closed sxyuan closed 9 years ago

sxyuan commented 9 years ago

Right now, updating a document after doing a find with certain fields selected will cause createdAt to be modified. This change makes the createdAt and updatedAt fields selected by default.

sxyuan commented 9 years ago

This could cause unexpected behaviour due to a quirk with how Mongoose selects fields of nested subdocuments.