Changing Document Shape Answer not valid

I successfully completed the match from Lab 1 and added the projection as requested, my output is:

{ "title" : "The Adventures of Robin Hood", "rated" : "PG" }
{ "title" : "Scott of the Antarctic", "rated" : "PG" }

I loaded the validate:

MongoDB Enterprise Cluster0-shard-0:PRIMARY> load('validateLab2.js')
MongoDB Enterprise Cluster0-shard-0:PRIMARY> validateLab2(pipeline)
Answer is 54

But none of these answers match the options for the lab? It says pick the best option out of: 15, 4, 30, 7.
Am I meant to guess or is my solution wrong?

No you are not supposed to guess. I would revisit the requirements and make sure they are all met. I would also make sure that I try to validate on the appropriate database/server.

I don’t see how it is wrong? The lab validates with an answer, it doesn’t say your projection is wrong, which it did when I forgot to include a field. So to me this is unclear, it seems to suggest that the lab validated, but it doesn’t give me an answer that is on the list of acceptable responses. If it wasn’t valid then I would expect it to say , which it seems to already do.

The lab says Using the same $match stage from the previous lab which I assume you got the right answer.

Are you connected to the shared cluster?
Are you using the same $match?

1 Like

My bad, I had an older (incorrect) version of my $match in the console. Corrected to the updated one and it was fine

Thanks :slight_smile: