FYI I think it is best not to post any code that is even an attempted answer, as posting the answers are against forum guidelines.
However, for your
- You only need to do this with the writers as it states in the Lab
However, the entries within writers presents another problem. A good amount of entries in writers look something like the following, where the writer is attributed with their specific contribution
“writers” : [ “Vincenzo Cerami (story)”, “Roberto Benigni (story)” ]
- Using $map a little too much… From the lab
$map lets us iterate over an array, element by element, performing some transformation on each element
Transformations happen in the
$match takes a document that specifies the query conditions. The query syntax is identical to the read operation query syntax; i.e.
$match does not accept raw aggregation expressions.
To deal with the issue of finding when a person appears in all 3 of the arrays it maybe best to perhaps search through the docs for a more appropriate Aggregation Pipeline operator
Hint Recall the vocabulary from Math Class