I have the following structure on node:
module.exports.find = function(pesquisa,frase){
return new Promise((resolve,reject) => {
pesquisa.find(frase, function(err,data){
if(err)
throw err;
else
resolve(data[0]['retorno']);
});
});
}
I'd like to make the search.find return a value for some variable where I could manipulate it, or something of the sort.