$or in mongodb compass

I’m trying for mongo db to show me only the pokemons that are Grass or Water trype, but it won’t let me filter it.
$or needs to be an array

Is there another way to filter an or?

>Solution :

Make it an array using brackets []:

$or: [{Type_1: "Water"}, {Type_1: "Grass"}]

Documentation for $or

You don’t need the $eq unless using a regular expression

Leave a Reply