In my javascript class, i have a function that return a list of things like so,
//ProjectClass.js
getProjectList: () =>
@Project.find (err, projects) =>
console.log(projects)
return projects
However, whenever I try to send a server response from nodejs
//App.js
project = new projectSchema.Project()
res.send(project.getProjectList())
I get the following as a response
{
"options": {
"populate": {}
},
"_conditions": {},
"_updateArg": {},
"op": "find"
}
Ironically, if I pass the res object to my getProjectList and send server response from my getProjectList function then everything works just fine.
Thanks for the help!