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

Adapt to changed mongoose behaviour #73

Closed vinerich closed 3 years ago

vinerich commented 3 years ago

Summary (Fixes #71)

Explanation

Somewhere along the versions 5.9 to 5.10 several changes where introduced:

So I changed the nModified check to include the new upserted property and am calling next() to return.

Additional

In #72 I tested my fix on different mongoose versions and it passed on both. I also tested with more versions on my machine. However this tests are not included into CI. I'm not sure if running 30 different version combinations is a good way to go.

I would propose to include Node v14 in the test, but only run with the newest mongoose versions. Your opinion @codepunkt?

vinerich commented 3 years ago

@codepunkt Maybe consider merging this PR. Last bump, I promise 😄