I'm directly doing await on asynchronous database operations. But the result is nothing. Here, is my code.
var channel_arr = await db.find({type:'pricing'},{channel_name:1},function(err,docs){
if(err) {
reject(err)
return;
}
var c = []
for(var o of docs){
c.push(o['channel_name'])
}
return c;
})
alert(channel_arr)
How do I resolve this issue?