question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

When the database is empty, using the ‘createReadStream’ method, no event is triggered

See original GitHub issue
db.createReadStream()
  .on('data', function (data) {
    console.log(data.key, '=', data.value)
  })
  .on('error', function (err) {
    console.log('Oh my!', err)
  })
  .on('close', function () {
    console.log('Stream closed')
  })
  .on('end', function () {
    console.log('Stream ended')
  })

tip: db database is empty

  .on('end', function () {
    console.log('Stream ended')
  })

event is not trigger

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:20 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
vweeverscommented, Nov 29, 2019

Good luck!

0reactions
xupengkuncommented, Nov 29, 2019

Yes, this is not a bug. This should be my problem. I will close this problem until I can reproduce it in an empty project. All in all, thanks for reminding

Read more comments on GitHub >

github_iconTop Results From Across the Web

Calling createReadStream() for uploaded file crashes in ...
Running in NodeJS 13.1.0: const { createReadStream, ... File upload object is empty in federated gateway but not if called directly on the ......
Read more >
why header event is not getting triggered in nodejs
I have this code in my one of the application. const readStream= fs.createReadStream('xlsx file path here'); readStream.on ...
Read more >
Node js Streams Tutorial: Filestream, Pipes - Guru99
In this tutorial, you will learn Filestream in Node.js Pipes in Node.js ... to a database, then the database connection event is triggered....
Read more >
Events and Streams in Node.js - codeburst
Here we wrote unsubscribing block of code ahead of triggering event for removing listeners attached to it. Note that second event raised goes...
Read more >
Event "end" in a ReadStream object seems not working if ...
Event "end" in a ReadStream object seems not working if properties "start" and "end" properties are used in the object specified as second...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found