mongoosejs/mquery

getting (node:92426) DeprecationWarning: collection.update is deprecated. when running with Node 14.5.0

Closed this issue · 2 comments

therk commented

Getting the following Depreciation Warning:
(node:92426) DeprecationWarning: collection.update is deprecated. Use updateOne, updateMany, or bulkWrite instead.
at NativeCollection. [as update] (node_modules/mongoose/lib/drivers/node-mongodb-native/collection.js:180:28)
at NodeCollection.update (node_modules/mquery/lib/collection/node.js:66:19)
at model.Query._updateThunk (node_modules/mongoose/lib/query.js:3773:23)
at model.Query. (node_modules/mongoose/lib/query.js:3811:23)
at model.Query._wrappedThunk [as _execUpdate] (node_modules/mongoose/lib/helpers/query/wrapThunk.js:16:8)
at backend/node_modules/kareem/index.js:369:33
at processTicksAndRejections (internal/process/task_queues.js:75:11)

We have the same Deprecation warning with

  • mquery 3.2.2
  • node version 14.15.1
(node:80826) DeprecationWarning: collection.update is deprecated. Use updateOne, updateMany, or bulkWrite instead.
    at NativeCollection.<computed> [as update] (/node_modules/mongoose/lib/drivers/node-mongodb-native/collection.js:180:28)
    at NodeCollection.Object.<anonymous>.NodeCollection.update (/node_modules/mquery/lib/collection/node.js:66:19)
    at model.Query._updateThunk (/node_modules/mongoose/lib/query.js:3806:23)
    at model.Query.<anonymous> (/node_modules/mongoose/lib/query.js:3844:23)
    at model.Query._wrappedThunk [as _execUpdate] (/node_modules/mongoose/lib/helpers/query/wrapThunk.js:16:8)
    at /node_modules/kareem/index.js:278:20
    at _next (/node_modules/kareem/index.js:102:16)
    at /node_modules/kareem/index.js:507:38
    at processTicksAndRejections (internal/process/task_queues.js:75:11)

As the deprecation warning suggests, use updateOne() or updateMany() instead.