-
-
Save RubyRonin/eaa6c73401cc9e4cae4dbf24f5ab4538 to your computer and use it in GitHub Desktop.
how to run function inside map
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const myList = docsFromStuff.map(document => ({ | |
// line 3 doesn't work | |
// how do I acheive this | |
var nameInfo = NameCollection.findOne({documnet.document.name}); | |
description: nameInfo.description, | |
status: document.status, | |
updateType: document.type | |
})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
User.find({key : value}).exec( (error,data) => {
if(!error){
code here use data.___ like data.user
}
});
try this!.