Chapter 1 Labor of Love Optional Lab

Here is my solution:

// Select the database to use.

var pipeline = [{


Im getting the wrong answer 1259. What is wrong with my solution.

Thank you in advance,

Hello @Mohammad_Jeragh, and welcome to the community,

have a look at how writers are represented in the data set. you will get what’s wrong in your solution.
next you will need some string manipulation. probably a $map and some String Expression Operators

good luck,


Hey @Mohammad_Jeragh,

I see that you have already completed the Quiz, its great you were able to find the solution.

As your post might give a potential solution to other learners in the forum, I have edited it to remove your aggregation pipeline.

I would like to highlight a good hint that @Imad_Bouteraa has shared with the community: Check the writers field in the dataset before adding the field in the $project stage.

Please feel free to reach out if you have a ny additional questions.

Kind Regards,
Sonali Mamgain

1 Like