Array operators query issue

i’m following mongo db course 001, chapter 4, lab 1 of array operators.
i’ve got the following quiz, and the query to solve it, but atlas ui tells me there’s something wrong in the query.
what’s wrong?

What is the name of the listing in the sample_airbnb.listingsAndReviews dataset that accommodates more than 6 people and has exactly 50 reviews?

{"$accommodates": {"$gt": 6}, "reviews": {"$size": 50}}

also tried this:

{"$gt": {"$accommodates": 6}, "reviews": {"$size": 50}}

Questions related to MongoDB university are better served in the university course specific forum.

What is the exact error? Posting a screenshot is the best way as we see the context in which the issue is happening.

One thing is sure is that if accomodates is a field name, then like reviews it does not take a leading dollar sign.

Hi @bb8,

I think the issue is using a $ which is unneeded before the Field name. Try

 {"accommodates": {"$gt": 6}, "reviews": {"$size": 50}}


1 Like

yes, that was the problem, thanks

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.