I am getting below error for the lab

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.

OUTPUT :

MongoDB Enterprise atlas-nzw8k3-shard-0:PRIMARY> db.zips.find({"$and" : {“pop” : {"$gt" : 1000000}}, {“pop”:{"$lt" : 5000 }} }).count()
2020-12-21T07:16:31.004+0530 E QUERY [thread1] SyntaxError: invalid property id @(shell):1:52

Please check $and syntax
Should be of the form

$and

Syntax : { $and: [ { <expression1> }, { <expression2> } , ... , { <expressionN> } ] }

What is the meaning of “…” in the output. anyways i did not get the output.

MongoDB Enterprise atlas-nzw8k3-shard-0:PRIMARY> use sample_training
switched to db sample_training
MongoDB Enterprise atlas-nzw8k3-shard-0:PRIMARY> db.zips.find({"$and" : [{“pop” : {"$gt" : 1000000}}, {“pop”:{"$lt" : 5000 }] }).pretty()

It means command is not complete
You might have missed some closing bracket
Please check again

1 Like

Hi @jasmeen_kaur,

Hope you were able to resolve the issue. Let us know if you are still facing any issue.

~ Shubham