You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I tries to get image using the GET request route /image/:filename, I am getting this error.
/home/mikhil/eth_lab/file-upload/node_modules/gridfs-stream/lib/readstream.js:68
this._store = new grid.mongo.GridStore(grid.db, this.id || new grid.mongo.ObjectID(), this.name, this.mode, options);
^
TypeError: grid.mongo.GridStore is not a constructor
at new GridReadStream (/home/mikhil/eth_lab/file-upload/node_modules/gridfs-stream/lib/readstream.js:68:17)
at Grid.createReadStream (/home/mikhil/eth_lab/file-upload/node_modules/gridfs-stream/lib/index.js:53:10)
at /home/mikhil/eth_lab/file-upload/app.js:125:30
at /home/mikhil/eth_lab/file-upload/node_modules/mongodb/lib/utils.js:508:9
at /home/mikhil/eth_lab/file-upload/node_modules/mongodb/lib/cursor/abstract_cursor.js:477:68
at /home/mikhil/eth_lab/file-upload/node_modules/mongodb/lib/utils.js:508:9
at completeEndSession (/home/mikhil/eth_lab/file-upload/node_modules/mongodb/lib/sessions.js:147:17)
at /home/mikhil/eth_lab/file-upload/node_modules/mongodb/lib/sessions.js:157:13
at maybePromise (/home/mikhil/eth_lab/file-upload/node_modules/mongodb/lib/utils.js:494:5)
at ClientSession.endSession (/home/mikhil/eth_lab/file-upload/node_modules/mongodb/lib/sessions.js:133:41)
[nodemon] app crashed - waiting for file changes before starting...
I tried to search for the solution in stackoverflow, and I got this link. In there, it is saying that, I would have to install an older version of mongoose (degrade from 6.0.13 to 5.13.7). But it would bring the deprication warning. Is there any other way such that, this issue can be avoided?
The text was updated successfully, but these errors were encountered:
Yeah the problem is gridfs-stream is written 7 years ago and it's using GridStore which is deprecated according to Mongodb doc and it's should be GridFSBucket now. I think the packages really need update
Hi everyone. I was trying out a youtube tutorial of this link.
This is my code.
This is the configuration for this project
When I tries to get image using the GET request route /image/:filename, I am getting this error.
I tried to search for the solution in stackoverflow, and I got this link. In there, it is saying that, I would have to install an older version of mongoose (degrade from
6.0.13
to5.13.7
). But it would bring the deprication warning. Is there any other way such that, this issue can be avoided?The text was updated successfully, but these errors were encountered: