Chapter 2: Basic Aggregation - Utility Stages

Hello,

I’m using the following aggregation, I think I ha vethe right query, but I don;t get any of the options to choose one.

Thanks!

PS: I just read the we should not post code.

In this lab you do not need to sort your result document’s set by “tomatoes.viewer.rating”: and “title”. Such sort can change order of resulting set. This is can be reason, why you get incorrect result

Hello Aleksei,

If I only sort by num_favs I don’t get the answer.

I think there is something wrong with my query.

Thanks.

Hello,

I made a change in countries to only match USA, but I still don’t get the answer.

	"countries":{$size: 1, $all:["USA"]},

Hello,

I found the issue, I was not projecting the rating, so I added the

“tomatoes.viewer.rating”:1,

to project, and that gave me the same result.

Thanks.

Hello,

I’m sorry that I posted code, but I removed the code posted.

Thanks.

@Farid_84129

Thanks for cleaning up and removing the code. I really appreciate that.

I’m not clear here whether you’ve solved your problem or whether you still have it? LMK and I’ll try to help. Good luck.

Hello,

Yes, I solved the problem. the difference was that I was not adding
“tomatoes.viewer.rating”:1,
to the project clause.

There is a different result when you add that field to project and when you don’t add that field to project expression.

Thanks.