Chapter 4 Lab - $facets unsolvable

Dear MongoDB university team,

The task of this lab is not solvable from the description given.

The problem is that more than 10 documents have a top-rating of 100.
Without a second sort criteria, the top 10 will be more or less random.
I wasted lot of time (as in most of the labs) to get an empty intersection set.

Since it took me lots of time and frustration again (as in several other labs) I ended up in guessing the answer. In the proposed solution I could see that the author thought of sorting by title additionally.

Since this is not the first time, that a lab is making me waste time, I’m questioning myself if I can afford to invest more time into these courses. I don’t know what is the typical audience of your courses. Speaking for myself, I am not a student with unlimited time to explore and make research, but a paid software engineer working on a project, paid by stakeholders.

Often it takes me a lot of extra time because the labs need further knowledge than handled in the chapter. Many labs are only solvable by doing extra recherche. This is frustrating because there wasn’t even a simple exercise before, trying out the theoretical knowledge treated in the chapter. It starts immediately with the advanced task.

I would prefer a course which delivers the needed knowledge in a straight forward way. Labs should treat the topics as explained in the chapter. There could be extra labs which combine the topic from the chapter with some extra features. I find this also valuable. But then as a bonus please, without the need to solve them.



Actually the problem was a different (the fact that first all documents have to be matched that have both fields filled out).

However the other statement about the labs is independent of that. Most labs contain advanced topics and are too time-consuming for me as a software engineer.


Sounds like you searched the forum to find hints and tips? One such example is here. I think the tutors should have stressed the importance of participation in/utilisation of the discussion boards. And with regards sort, although it’s logical to include it, excluding it has no impact to the final result with this specific dataset; discussed here.

From what I gather, it’s a mixture of professionals and non-professionals. I myself am a professional and I was taking batches of 3 courses in a given session. So it is doable. I would encourage you to persevere and if you’re stuck, post a question.

The point about the expectations of the labs has been mentioned in multiple threads. Here’s one such example and I’m sure that they’ll iron all this out in the upgraded lessons that’s soon to be released.

Yes I will continue the course since I find the content has some value. However I won’t invest more time into the labs. Instead I will try to guess the answer and then see the solution description and learn from it.

I just don’t have the time to spend that extra time for the labs.

Hi @Alexander_09877,

Thanks for sharing your feedback regarding the course!!

We are in process of upgrading our courses and user feedbacks like this are beneficial for us.

I would recommend you to go through our documentation as well so that you can learn more about the Aggregation concepts not mentioned in the video lectures:

To have deep understanding of aggregation, you need to practice a lot and documentation is a good resource for the same.

Please let me know, if you have any questions.


Hi @Sonali_Mamgain, @007_jb,

I have identical feeling which @Alexander_09877 described (and I also had to guess 3 times and failed the lab just to see the correct solution, which surprised me)

I understand that students have to spend some time for research and read the official documentation, but the task really has wrong description and when you make two separate requests and sort by each of the two fields you can see that there is no intersection between the two tops.

When I realized that, I had to go to the forums and started searching for some hint what is wrong.
Then I found this thread Chapter 4 Lab - $facet, which actually, misleaded me and I wasted even more time trying to solve the task with a different “top 10” interpretation.

One more thing: in lectures it was mentioned that it is not possible to use results of one facet in another, but it would be so useful to mention that both facet results can be used in a next stage of the main pipeline. Because my understanding was after the lecture that $facet is the final stage.

Hi @Oleksandr_Humeniuk,

Thanks for sharing your feedback!!

I would recommend you to go through the “Detailed Answer” and also share your aggregation pipeline so that we can help you in understanding the concept and the Lab. This process will also help us in capturing and implementing the valuable user feedback.

I have initiated a discourse inbox message thread with you. Please reply there with your aggregation pipeline.

I would highly recommend you to refer the MongoDB Aggregation Documentation as it explains the concept in detail along with the examples:

Please feel free to reach out if you have any questions.


I agree with the sentiment expressed in this thread.

The preceding lessons are not always covering the skills needed for the labs.

For this lab, specifically, the problem is that the lessons present the facets $sortByCount, $bucket and $autoBucket. None of those are used in the labs however. Instead, you are to create facets from other aggregation pipelines, which is a technique that was never explained in the lessons.

This mismatch of skills taught and skills needed makes the course needlessly confusing.

Hi @Nikolaj_Lundsgaard,

Thanks for highlighting this!!

Aggregation Framework is a broad concept and we highly recommend referring to documentation while going through this course.

I understand your point here and to fill these gaps we are in process of updating the course.
Meanwhile if you have any doubts, please feel free to post it on our discussion forums for support.


1 Like

Just for highlighting, the description is really driving us to a hole, but research is part of solutioning problems, still trying to find out the exercise solution.

I just solved the problem, it was a bad data from one of the fields, Compass cam show this mad cases…

@Sonali_Mamgain As @Alexander_09877 have mentioned the Lab’s descriptionis has no statement that we should count only records with BOTH field. As @Alexander_09877 did, I have also filtered records with ‘imdb.rating’ and ‘metacritic’ fields independently from each other which led me to a wrong result - such type of filtration was obvious and natural for me.
PLEASE make a statement about requierd filtration in the Lab’s description.

Todays Lab’s description: How many movies are in both the top ten highest rated movies according to the imdb.rating and the metacritic fields? We should get these results with exactly one access to the database.

I agree with you. Picking up limited 10 top movies is questionable. What happens if there are 20 movies which have the same imdb.rating=9.9 and metacritic=99.9? Selecting the first 10 movies by $limit() could miss some movies in one way or another. The reason it has the correct answer is, in this case, it happens to have just one movie matching the criteria.

This lab should use $bucket() to solve the problem. Otherwise, we can filter imdb.rating>=9.0 and metacritic>=90.0, which can also get the “1” answer.

In my personal opinion, this lab should do this:

  1. Use $bucket to arrange the imdb.rating between 9.0 and 10
  2. Use $bucket to arrange the metacritic value between 90 and 100.
    (Both above mean all movies falls in top 10 percent, rather than the first ‘top 10’ movies. )
  3. Based on the result of $bucket, we can use $setIntersection() to obtain the movie _id(s) to meet the condition. (Before run $setIntersection(), use $unwind)

If you like, I can share my pipeline() with you. Thank you so much.

you have to filter documents contain both imdb.rating and metacritic fields first to get the corrected answer, which is not clearly stated in the question. took me a while to figure this out, very misleading