I am working on a node.js app where upon login, we need to send lots of information from different entities to user, to fill their dashboard.
So instead of holding the response till we get all the things from the database, I am trying to send chunks of information as they come. I believe res.write is the method that I suppose to use.
I am using mongoose, so instead of using await for all my queries. I fire them all side by side (in hope of speeding up the process).
Eventually, I need to end the response, but I don't know how to be sure if everything that I need is being returned(all tasks are completed).