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
I have used below code for retreiving image from gridfs but getting error "Cannot read property 'readPreference' of null at new GridStore"
var readstream = gfs.createReadStream({ filename: file.filename }); //error handling, e.g. file does not exist readstream.on('error', function (err) { console.log('An error occurred!', err); throw err; }); readstream.pipe(response);
The text was updated successfully, but these errors were encountered:
Hey, have you got any solution. Please let me know asap. Email : [email protected]
Sorry, something went wrong.
Refer to #131, you may go back and try to configure the connection of GridFs. Instead of using the connection object, you may use connection.db
connection
connection.db
const Grid = require("gridfs-stream") let gfs // ...connect the database const {connection,mongo} = mongoose gfs = Grid(connection.db, mongo) gfs.collection('bucketName')
No branches or pull requests
I have used below code for retreiving image from gridfs but getting error "Cannot read property 'readPreference' of null at new GridStore"
The text was updated successfully, but these errors were encountered: