Get_movies fails to return correct number of comments

I have looked through the existing thread, and even tried the ‘corrected’ example ( [Pablo_Van_Mechelen_88802] Jun 20th (I am using “as”: “comments”, but I still end up with the the comment counting not working.
When I look in compass, using the lookup and locking the id to 573a1394f29313caabcdfd61 (lady and the tramp), I see 126 entries (0-125) in the ‘comments’ array, but the test reports 0.

Also, with the $lookup in compass having the local and foreign fields, doesn’t that imply a match between the two (it certainly seems that way) and the code generated by compass does not include a ‘let’ or ‘match’ statement - I get the same results if I just use the code generated by compass as compared to the posted correct answer.

Please advise


Hi @Winston_Worrell

It’s somewhat difficult to understand what aspect you are at in terms so it might be more useful to message me your current code workings as these shouldn’t be shared in the forum posts.

Firstly, I’d get you to double-check you have added the skip stage before the limit stage in the get_movies function to the cursor call.

In the match stage within your $lookup are you using $expr and $eq to compare the movie_id and the id?

There are quite a few aspects particularly in the aggregation pipeline where there is the possibility for an omission that could result in no documents being returned so as I mentioned at the start, it’s best to directly mail the code so I can review and then I can share what areas you may be missing or want to focus on.

Kindest regards,
Eoin

Hello Eoin,
I have be trying to reply to you via outlook.com but I keep getting an undeliverable error. I also noticed that your email address is community-noreply@mongodb.com which may be setup not to receive emails.
How do I directly email you?

Delivery has failed to these recipients or groups:

community-noreply@mongodb.com (community-noreply@mongodb.com)
The address you sent your message to wasn’t found at the destination domain. It might be misspelled or it might not exist. Try to fix the problem by doing one or more of the following:

  1. Send the message again, but before you do, delete and retype the address. If your email program automatically suggests an address to use, don’t select it.
  2. Clear the recipient AutoComplete cache in your email program by following the steps in this article: Status code 5.1.1. Then resend the message, but before you do, be sure to delete and retype the address.
  3. Contact the recipient by some other means (by phone, for example) to confirm you’re using the right address. Ask them if they’ve set up an email forwarding rule that could be forwarding your message to an incorrect address.

Regards,
Winston.

Hi @Winston_Worrell

If you click on my photo and in the top right of the pop-up there should be a ‘message’ button. If you click the ‘message’ button, it should open a tab on the lower half of the screen similar to how you post for the forums that will instead send me directly a message.

Sorry for any confusion around how to use the message functionality.

Kindest regards,
Eoin