Skip to content

Instantly share code, notes, and snippets.

@elct9620
Created January 4, 2017 08:27
Show Gist options
  • Save elct9620/bbd0313c3a92e50c3b4151182cf5ba14 to your computer and use it in GitHub Desktop.
Save elct9620/bbd0313c3a92e50c3b4151182cf5ba14 to your computer and use it in GitHub Desktop.
/*
doc.Items.map(function(id) {
return Check.
findById(id.toString())
.then(function(doc){
doc = doc.toObject();
return doc;
})
})
*/
var results = [];
Pormise.all( doc.Items.map( (id) => { Check.findById( id.toString()) }) )
.then( (values) => {
// Values
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment