data.forEach(function(shelf){
books.find({"shelfid":shelf.id},function(book){
//book1,book2,book3
})
});
Each shelf has an id, and i find all books which has those id's. So assume that this method finds 3 books, how do i response all those books at the same time, when the foreach is completed.