Advertisement
Guest User

Untitled

a guest
Aug 18th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. db.find().then(docs => docs.forEach(doSomething));
  2. nextFunction();
  3.  
  4. const docs = await db.find();
  5. docs.forEach(doSomething);
  6. nextFunction();
  7.  
  8. const docs = await db.find();
  9. await Promise.all(docs.map(doSomething));
  10. nextFunction();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement