In the first homework of chapter one: I am getting count as 24 & not 23!

In the first homework of chapter one,
i used my query statement & verified. The total count of documents returning is 24 & not 23…!
i am always getting the statement: “You aren’t returning the correct number of documents” as a result…!

Please help…! If you want i can type the query for anyone to validate…!

Check this thread.It may give some clues

Not getting 23 results for lecture lab $match

1 Like

@Sonali_Mamgain Can you help me out…!

var pipeline = [ { $match: { “imdb.rating”: { “$gte”: 7 },
“genres”: { “$ne”: “Crime”, “$ne”: “Horror” },
“$or”: [{ “rated”: “PG” }, { “rated”: “G” }],
“languages”: { “$all”: [“English”, “Japanese”] }
}
} ]

I have understood the statement & typed it correctly…! Still i am getting 24 as the result…!
Why? Is something wrong in my query? I am new to this community thing, dont know where to inbox…! Please help me

@steevej What is wrong in the below pipeline statement. Why i am getting 24 as the answer. I even took pain in seeing each document & it was matching the criteria. Why i am getting one extra?

var pipeline = [ { $match: { “imdb.rating”: { “$gte”: 7 },
“genres”: { “$ne”: “Crime”, “$ne”: “Horror” },
“$or”: [{ “rated”: “PG” }, { “rated”: “G” }],
“languages”: { “$all”: [“English”, “Japanese”] }
}} ]

In the thread link supplied by @Ramachandra_Tummala, the post

explain why the following is wrong

As a courtesy to all please do not post twice the same question as it slows all by having to read multiple time the same thing.

1 Like