We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi. I'm new with node, so i could write wrong code.
I'm trying to read a file saved into collection "fs.files". My code is:
var readstream = gfs.createReadStream({ _id: file_id, readPreference: 'secondaryPreferred', w: -1 });
I obtaing this error: **node_modules/mongodb/lib/gridfs/grid_store.js:205 return executeOperation(this.db.s.topology, open, [this, options, callback], { ^
TypeError: Cannot read property 'topology' of undefined**
Could someone give me help? Thanx
The text was updated successfully, but these errors were encountered:
same here
Sorry, something went wrong.
Same but when trying to use gfs.remove({ _id: mongoose.mongo.ObjectId(req.params.id)})
gfs.remove({ _id: mongoose.mongo.ObjectId(req.params.id)})
I am facing the same issue and any solution for this?
let gfs; const conn = mongoose.connection; conn.options = {}; conn.once('open', () => { gfs = Grid(mongoose.connection, mongoose.mongo); gfs.collection('uploads'); }); router.get('/image/:filename', getFile) function getFile(req, res, next) { var readstream = gfs.createReadStream(req.params.filename); readstream.pipe(res) }
No branches or pull requests
Hi.
I'm new with node, so i could write wrong code.
I'm trying to read a file saved into collection "fs.files".
My code is:
var readstream = gfs.createReadStream({ _id: file_id, readPreference: 'secondaryPreferred', w: -1 });
I obtaing this error:
**node_modules/mongodb/lib/gridfs/grid_store.js:205
return executeOperation(this.db.s.topology, open, [this, options, callback], {
^
TypeError: Cannot read property 'topology' of undefined**
Could someone give me help?
Thanx
The text was updated successfully, but these errors were encountered: