Left join with group by and having clause in mongoose

153 views Asked by At

I have one collection named users and second collection named videos. I want to perform left join with group by and having clause. I know how to do in mysql but not getting how to get it in Mongoose.

Below are my collectionsenter image description here

in mysql query can be like

"select u.id,u.masterid, count(v.vid) from users u left join videos v on u.id=v.uid group by u.id having u.masterid=1"

I have found few solutions related to group by or left join here but not with having clause. Any help is appreciated.

Thanks

0

There are 0 answers