Chapter 4, Lab 1: Comparison Operators, Answer Update

Hi,

db.zips.countDocuments({"pop":{"$lte":1000}})

the latest query structure returns answer 8070.
As well,

db.zips.find({"pop":{"$lte":1000}}).count() 

also returns answer 8070 please update the solution.

Thanks.

The question is asking for cities with populations less than 1000:

How many documents in the sample_training.zips collection have fewer than 1000 people listed in the pop field?

Your query is not written to satisfy this requirement.

1 Like