lykmapipo / mongoose-gridfs

mongoose gridfs on top of new gridfs api
MIT License
91 stars 39 forks source link

Stream variant doesn't work #23

Closed talha-asad closed 6 years ago

talha-asad commented 6 years ago

readById works well with the callback version, that provides a buffer but the stream version just errors out and doesn't work. Does it work for you?

Below is the error I get:

TypeError: Cannot read property 'on' of undefined
      at GridReadStream.Readable.pipe (_stream_readable.js:585:7)
      at router.get (test/src/index.js:120:79)
      at <anonymous>
      at process._tickDomainCallback (internal/process/next_tick.js:228:7)

The id for the file seems to be correct.

talha-asad commented 6 years ago

It does, sorry I had it setup wrong.