I am looping over a collection of Users in node using mongoose. I want to save the data of every User in a excel File.
Usr.findById(usrID, function(err, foundTagestipp){
sheet1.set(1, counter, 'some Userdata');
}
The problem is that I want to save the file after it went through the whole collection.
So when do I know when the last user is done? Can I somehow give that to a callback or can I somehow get information from mongoose when it is done?
I hope it is clear what I meant by that... Sorry for the nooby question