Skip to content

Instantly share code, notes, and snippets.

@RubyRonin
Created May 17, 2018 06:56
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 RubyRonin/eaa6c73401cc9e4cae4dbf24f5ab4538 to your computer and use it in GitHub Desktop.
Save RubyRonin/eaa6c73401cc9e4cae4dbf24f5ab4538 to your computer and use it in GitHub Desktop.
how to run function inside map
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
}));
Copy link

ghost commented May 21, 2018

User.find({key : value}).exec( (error,data) => {
if(!error){
code here use data.___ like data.user
}
});

try this!.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment