Skip to content
This repository was archived by the owner on Aug 12, 2025. It is now read-only.
This repository was archived by the owner on Aug 12, 2025. It is now read-only.

Gridfs-stream createReadStream #140

Open

Description

@crossSulation

const readStream =this._gridfs.createReadStream(file.filename);
readStream.on('error',(error)=>{
resp.send('No Image from that title!');
resp.end();
})
readStream.pipe(resp);

code like these, when only set up the readStream with filename, it will throw error ,
this._store = new grid.mongo.GridStore(grid.db, this.id || new grid.mongo.ObjectID(), this.name, this.mode, options);

when I debug, I found grid.mongo.ObjectID is undefined

Activity

  1. crossSulation commented on Dec 18, 2018

    @crossSulation
    Author

    By the way, i am using mongoose

  2. crossSulation commented on Dec 18, 2018

    @crossSulation
    Author

    sorry, my fault, actually, when construct the GridFSStream, the second argument should the the instance of mongodb

    this._gridfs = GridFSStream(this._conn.connection.db,conn.mongo)

  3. crossSulation commented on Dec 18, 2018

    @crossSulation
    Author

    Made a mistake, actually ,it works, when construct the GRIDFSStream, the second argument should be
    the instance of moogodb

    this._gridfs = GridFSStream(this._conn.connection.db,conn.mongo)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions