Stuck with Chapter 1 Computing fields

I tried to do the Lab but I am stuck i construct a $project aggregation with a condition $cond like if the size of the tittle array returned by the split is a value greater than 1 return $REMOVE if it is one return tittle but I have a output like that then when i use itcount() the value is not correct
{ }
{ }
{ }
{ }
{ }
{ }
{ }
{ }
{ }
{ “Movie Title” : “Cinderella” }

I need to exclude this empty values is possible don’t use else in the $cond expression or could have a clue? could I post the sentence?

The best way I found to build a pipeline is to do it stage by stage because if you try with all your stages at the same time it is very hard to find which one is causing the problem.

I always put my work in file as it is easier to edit than doing it directly on the mongo shell. For example, my file for this lab is m121_lab_1.js and when I test it I just do ‘mongo < m121_lab_1.js’.

The first thing you have to do is to find out if your ‘$split’ is working fine. At this point your .js file should look like:

use theSpecifiedDatabase
const project = // a projection that uses split
const pipeline = [ project ]
db.theSpecifiedCollection.aggregate( pipeline )