Closed bailor1 closed 2 years ago
Perhaps this Mongo documentation about moving away from isConnected()
could be of use: https://mongodb.github.io/node-mongodb-native/3.3/reference/unified-topology/
If you check the code you'll see that the isConnected
function is only executed if is present. When the function is finally removed it will not be used anymore and the library will still work. The warning is the price to pay for compatibility.
Describe the bug When used with MongoDB v5, the following deprecation warning is displayed due to the usage of
isConnected()
within multer-gridfs-storage:Environment
I'm using
multer-gridfs-storage
version 5.0.2My installed MongoDb version is 5.0.8
I have Multer 1.4.3 installed to upload files
The Node version used to run the code is 17.4.0
To Reproduce Simply create a new GridFsStorage in node. I traced the depreciation from the
new GridFsStorage()
call (not including parameters because they're irrelevant to the deprecation):The warning occurs because of the
isConnected()
call in the following screenshot:The warning is thrown within
myapp/node_modules/mongodb/lib/mongo_client.js
:Expected behavior Not showing the warning/the package no longer being deprecated