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

Removed deprecated functions from mongoose.connect() #61

Closed vinerich closed 4 years ago

vinerich commented 4 years ago

Changes are removing deprecated functions from the initial mongoose.connect() call. In the test log are still deprecated functions

// Changing this breaks the current test behaviour so I'm leaving it.
(node:11812) DeprecationWarning: collection.update is deprecated. Use updateOne, updateMany, or bulkWrite instead.

// Changing this one to deleteOne() or deleteMany() is causing the issue that these functions
// do not call any hooks. If we have no hooks we cannot delete patches when a document is deleted,
// so we are stuck with the deprecated remove()
(node:11812) DeprecationWarning: collection.remove is deprecated. Use deleteOne, deleteMany, or bulkWrite instead.