I need plain javascript object instead of mongoose object.
Query
chatModel.find({'userId':userId},{
"_id":0,"message":1,"type":1
}).sort({createdDateISO:-1})
.lean().exec((err,result)=>{
});
But I will get mongoose object when I remove the sort()
I am getting the plain javascript object.
How do i get the plain object with sort??