MongoCompass $lookup does not generate the right result - GetComments

Can anyone please help me why the following simple $lookup does not generate the desired result?

I’m trying to join the text field from the comments collection with the _id field in the movies collections as movieComments. However, it’s returning an empty array.

Can anyone please help me out?

Here’s the image:

Thank you.

Because it’s a simple $lookup, and it does absolutely nothing about matching the “comments” or ordering them by “date” like the question is asking you to do. ( HINT - It’s by something a bit more concrete than “text” );

Before posting please read the other threads on exactly the same topic, since you’re not the first to ask.

The video lesson just before the exercise gives you pretty strong hints as to what to do here ( as well as how to “join” movies and comments, and by which fields to do that ). There is also ample documentation showing the different ways to do things.

1 Like