Chapter 4: Lab 2: Comparison Operators

Hello,
The question for the Lab 2 is:
“How many documents in the sample_training.zips collection have fewer than 1000 people listed in the pop field?
Copy/paste the exact numeric value of the result that you get into the response field.”

To complete the task I used the next line inside sample_training:
db.zips.count({“pop”:{"$lt":1000}})
and the result was: 8024

After fail the three attempts that we have, I could see the correct value to pass the lab was: 8065

To verify that information, I checked the detailed answer and I copied and pasted the line to get the correct result:
db.zips.find({ “pop”: { “$lt”: 1000 }}).count()
BUT the result is still the same: 8024

It seems there is a mismatching between the course and the database.

How can I pass the labs if the information is not the same? Can you change the result of my lab to “Passed”? Am I missing something?

Thank you so much.

Same thing for Lab 1: Logic operators

If you do not get the same answer with the same query, then it means you have altered the data set or you are using the wrong data set.

Hi Aurora,

finished the M001 some weeks ago by the end of last year. Therefore, connections were fresh and ready to use, checked the Lab2 thing against my Atlas account and found the 8065, not 8024. Looking back, some Labs later, I didn’t manage to find the right answer in an $and [ $or: , $or: ] scenario, so lost one Lab. Wrote to the Team, however, got no answer, did pass my thing anyway.

So, I know, loosing a Lab is no fun, however, maybe it isn’t the end of the world either?

Maybe, you want to check the total count of your collection like db.zips.count(); . If zips are missing out, maybe some unintendend glitch happended with the database and it might be worth while dropping the whole sandbox Cluster0 thing and set it up anew?

Hope, you’ll find a path forward soon. - Regards, M.

I think then there should be a way to reset the database. I am also facing the same issue. My count is not same.

I just tried resetting the complete cluster database. If you face any issue then follow this question: Restore the Sample Data for MongoDB M001

Also, you can check the steps to reset in Chapter-1, lession: Lab: Connect to your Atlas Cluster

and after resetting the dataset, I am getting the correct answer.

1 Like

I receive a different numeric answer instead of 8024 above and it (8065) was graded correct. Also to share that there is 2 ways to count:
db.zips.count({“pop”: { “$lt” : 1000 } })
db.zips.find({“pop”: { “$lt” : 1000 } }).count()