I am new to node and loopback, I wanted to execute a raw query with call back and I am getting result as well in anonymous form My query is :
query = `select u.modelid from ${ schema }.dayjob as u where jobid = 1 and createdat::date > '2019-11-15' and createdat::date < '2019-11-22' ;`
for which I am getting [ anonymous { modelid: 177 } ] as output
Is there any specific way to get rid of 'anonymous' ?
anonymous in loopback represents the model you are querying is anonymous. The model defined by loopback for RawQueries.
It would display if you console.log the query result directly but not exposed when you convert to json. Try logging it by converting to JSON
results.forEach(function(result) {
var res = result.toJSON();
console.log(res);
});