Syntax to combine multiple operators

Hi, I am having some trouble writing a query where I combine multiple operators. Can someone help me?

E.g. Dog Database

Name: Rex
Age: 2
Breed: Array
0: German Shepherd
1: Pitbull
2: Border Collie
3. Terrier
Sex: M

I want to find just results for dogs where Age is older than 3, Breed is either German Shepherd or Border Collie, and Sex is M (Male). So only dogs who meet all these criteria.

The operators are clear to me but I don’t know how to write the syntax to combine them.

So I would need to write a query that combines all these…?
db.dogs.find({“breed”: {"$in": [“German Shepherd”, “Border Collie”]}})
db.dogs.find({“sex”: “M”}).count()
db.dogs.find({“age”: {$gt: 3}})

Try This :

db.dogs.find({“breed”: {$in: [“German Shepherd”, “Border Collie”]} , “age”: {$gt: 3}, “sex”: “M”});