Lab - Computing Fields

I don’t know if it didn’t work because they were in the same stage, but the result of split is not an array.

an array is when it has key and value pairs, closed by {}?
and list is just values closed by ?

I used $split and $size in $project stage, and $match as another stage just to sort the results to show only titles with 1 word. Isn’t it right?

But as I cannot identify wich document has a title with 1 word, $match: {$eq: 1} just shows 0 documents.

Do I have to use $split and $size in different types of stages?

One stage for $split and a different stage for $size. Don’t put them in the same stage.

different type of stage as well?

Yes indeed @Guy_40794 :slight_smile:

The project stage you used for $split is fine. You need to use a different type of stage for $size. Think about it.

@007_jb thank you very much!

It worked, bu I had to add a field with $addField, is that the right way to go?

Good job! Have a look at the detailed answer and compare it with you did.