I'm new to nodeJS and JS.
I'm need to fetch data from mongoose collection using findone and wanted to store in a variable. Below code is storing value in resultarray but not in memindex. Not sure how to store in memindex.
memindex = Manufacturer.findOne({name: result[key].name}, function(err, resultarray) {
console.log("resultarray", resultarray);});
The reason why I need value in memindex is, I need to use this in another condition.