Chapter 1:lab $match issue

I tried following query for getting no. of movies.
var pipeline = [{
$match: {“imdb.rating”:{"$gte":7},
“genres”:{"$nin":[“Crime”, “Horror”]},
“rated”:{"$in":[“PG”, “G”]},
“languages”:{"$in":[“English”, “Japanese”]}} }]

db.movies.aggregate(pipeline).itcount()

but no of movies is 877.

Help me out.

but getting an error

The issue might be with languages query. Check requirements

I did not get what you explained, can you please elaborate?

You’re looking for movies with “English” or “Japanese” language. But instead, you need to find “English” AND “Japanese” in the same movie.

2 Likes

Thanks everyone for their kind help, got the answer using the $all operator.
Thanks Again.