Quiz Chapter 4 same data answer after reload

This question : # of zips over 1 Million or under 5000.
So spoiler , there are just 4 over 100,000 and they are under 200,000
that leaves the query as simple as lt <5000 Problem is my answer 18277 is flagged wrong.

I dropped the Db cluster and reloaded it and still get same answer. mongodb+srv://:@cluster0.x6u09.mongodb.net/test

Question : this answer must be vetted and I have changed the query to also do 4000 and the data makes sense.

What seems to be the issue with such an apparent trivial search ?? and I want to proceed but need to get this right.

Using Mongosh from Compass

db.zips.find({
“pop”:{"$lt":5000}}).count()

Your query is find to count number of zips with less than 5000 people. But that was not the question.

The question is

How many zips in the sample_training.zips dataset are neither over-populated nor under-populated?

In this case, we consider population of more than 1,000,000 to be over-populated and less than 5,000 to be under-populated.

With $lt:5000 you simply counted the number of zips that are under-populated.

oops exactly between not either over or under, Thanks

2 Likes