How can i return the rows of a table (model) if i don't want to send it to response via response.json()
of response.ok()
.
i have user
model
api/model/User.js
module.exports = {
attributes: {
name:{
type:'string'
},
age:{
type:'text'
}
}
};
I am writing a function in api/services/sendList.js
module.exports=function sendList(model){
model.find({}).exec(function(err,rows){
//here i dont want to send it as res.json(rows)
});
/***i want to return the rows obtained so that it can be used
*somewhere else(wherever the function **sendList** is being
*called.)
*/
}