Chapter 2: Basic Aggregation - Utility Stages Lab: Using Cursor-like Stages

Hi, I’m pasting the answer provided in the solution in mongo shell and its running without any errors, but unfortunately it does not return any answers, can you guys please help.

N. B. : I’m connected to movies db.


Can you please elaborate. It returns results/data but none of those are the answers you were expecting? Or it’s not returning any results/data?

Hi @byezid_71920,

Please check your discourse messages for more discussion on the aggregation pipeline.

Let me know, if you have any questions.


Hi, Here is my code, Please tell me what is the error here because it is not returning any results -

In your last $sort, only the field size exists as your last $project does not include the other 2 fields.

1 Like

Hi @Shiva_23760,

There are few things missing in your aggregation pipeline, please ensure that all the lab requirements are met.
Moreover, as mentioned by @steevej-1495, you will have to project all the fields that you need in the later stage.

Please let me know, if you have any questions.

Edit: I have removed the code from your post as it might give hints to our other forum users.