codepunkt / mongoose-patch-history

Mongoose plugin that saves a history of JSON patch operations for all documents belonging to a schema in an associated 'patches' collection
MIT License
96 stars 21 forks source link

fix: upsert with multi property #89

Closed vinerich closed 2 years ago

vinerich commented 2 years ago

When upserting a document without changes with multi: true, a patch is added as stayed by the test.

This is however a wrong behavior as no patch should be added when no changes are present. This faulty behavior is cause by a leftover variable name change from many to multi. Which caused the wrong hooks to be executed.