Chapter 1 - Optional Lab // Wrong Answer?

Hello, somehow I am getting the answer 1259 for this question (which was another answer). I have browsed some other similar topics, but my pipeline seems different that what was asked in those topics.

In my pipeline, I used two projects. I specified the field containing $setIntersection in the first one (I named the field as “labors”), then used the second project to make a new field containing boolean to see if the “labors” array have elements using the following :


Then I use the $match function afterwards to filter out the true ones.

I would love to share my whole pipeline syntax if possible. From the above condition, which part would make the difference in the filtering and why? Thank you in advance.

1 Like

Same here.
1259: because you find labors at the same stage with $project: {
cast: { $map: {…} }, directors: {…}, writers: {}
you need to move it to the latter stage.

1 Like

That’s good to know. I also hist the same issue.

Hi @Rama_N_A,

As mentioned by @Tr_n_D_i if you compute a field in the $project stage, you cannot use the newly computed value in the same $project stage.

I believe this is the reason for wrong answer. I have initiated a discourse inbox message with you to debug the pipeline.

Please do let me know if you have any additional questions.

Kind Regards,