MongoDB syntax error I’m having and error, and I’m not sure how am I supposted to fix it.

It looks like you are using mongosh
Courses are designed to work with mongo shell

What’s wrong with this one?

Hi @Ceki_N_A,

The find function expects an object, you are not providing one here.
I think what you are actually trying to do here is this:

db.zips.count({"pop": {"$lte": 1000000, "$gte": 5000}})

Mongo Shell or mongosh should not make a difference here.


Solved it, thank you very much.

Best regards,

1 Like