saintedlama / mongoose-version

Mongoose plugin to save document data versions. Documents are saved to a "versioned" document collection before saving original documents and kept for later use.
BSD 2-Clause "Simplified" License
144 stars 35 forks source link

Custom validators on Mongoose schema are run twice #30

Open pawelotto opened 6 years ago

pawelotto commented 6 years ago

When mongoose-version plugin is enabled then custom validator functions on Mongoose schema are run twice with every request.

pawelotto commented 6 years ago

To be precise, validator is run as many times more as there are old versions in the __versions collection. If there are 100 versions, this is run 100 times...