Chapter 1 Imdb field not populated

I am trying do the first lab and the requirement of imdv.rating of 7 or above returns no records. The dataset has only a field of imdb, no rating anywhere and nothing seems populated for that field.

Hey @Austin_Summers,

Welcome to the MongoDB Community Forums! :leaves:

It is not returning any documents because your query is not properly formatted as it is pointing out below your query by returning the following statement:

Stage must be a properly formatted document

Kindly wrap the field name imdb.rating in quotes ie. the stage would look like this:

{
   "imdb.rating": { $gte: 7 }
}

Let us know if there is any doubt about this. Feel free to reach out for anything else as well.

Regards,
Satyam

2 Likes

Thank you. I didn’t catch that it had fields under imdb. Should field names always be in quotes, because I have gotten them to work without (in Compass).

1 Like

For accessing fields that are object such as imdb in our case, one is required to put them in quotes to access fields inside them. If we take fields that are non-objects, eg. runtime, it would work with or without quotes as you would have seen as well :smile::

Regards,
Satyam

1 Like

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