graphql-compose-mongoose icon indicating copy to clipboard operation
graphql-compose-mongoose copied to clipboard

Mongoose Deprication Warnings

Open michaelwclark opened this issue 6 years ago • 2 comments

Mongoose (actually mongo driver underlying i think) has depricated many fields in the most recent versions. I believe this package is triggering lots of warnings about this.

Example Warnings

(node:46925) DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead.
(node:46925) DeprecationWarning: collection.update is deprecated. Use updateOne, updateMany, or bulkWrite instead.
(node:46925) DeprecationWarning: collection.remove is deprecated. Use deleteOne, deleteMany, or bulkWrite instead.
(node:46925) DeprecationWarning: collection.count is deprecated, and will be removed in a future version. Use collection.countDocuments or collection.estimatedDocumentCount instead

package.json (excerpt)

    "graphql": "^0.13.2",
    "graphql-compose": "^4.3.0",
    "graphql-compose-mongoose": "^4.1.1",
    "graphql-iso-date": "^3.5.0",
    "graphql-tools": "^3.0.2",
    "graphql-type-json": "^0.2.1",
    "mongoose": "^5.2.10",

michaelwclark avatar Aug 27 '18 21:08 michaelwclark

This warning are still being thrown. Is there a timeline to fix this?

israelglar avatar Jan 11 '19 11:01 israelglar

I don't have enough time right now. PR can be quite simple, like this https://github.com/graphql-compose/graphql-compose-mongoose/commit/487884488eeb977b64d880ae4b0e15b547f25d2a#diff-2944c7c61cd747255906ed1c091ea146

I will be very happy if someone makes PR. 😉

nodkz avatar Jan 11 '19 18:01 nodkz