Irfan Khan
Irfan Khan

Reputation: 415

and condition inside or condition mongoose

I want to query that has and condition inside or condition my query

ChatGroup.find({$or:[ {$and : [{'members.user_id':user_id},{'members.is_removed':false} ]}, {'created_by':user_id} ]}]})

but it is not giving me desired result

Upvotes: 1

Views: 262

Answers (1)

Irfan Khan
Irfan Khan

Reputation: 415

I have to use $elementmatch for above query so I get my desired query result

Upvotes: 1

Related Questions