Skip to content

Instantly share code, notes, and snippets.

@patarkf
Last active June 11, 2017 15:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save patarkf/d4af753a820b573da280a737c2b6354b to your computer and use it in GitHub Desktop.
Save patarkf/d4af753a820b573da280a737c2b6354b to your computer and use it in GitHub Desktop.
const posts = [{}, {}, {}];
function insertPostsConcurrently(posts) {
return Promise.all(posts.map(doc => {
return db.insert(post);
})).then(results => {
console.log(results);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment