Chapter 1: Basic Aggregation - $match and $project. where do we create the pipeline variable?

the lab asks to create a variable called pipeline and feed it to validateLab1(pipeline). but doesnt specify where exactly this variable is to be created. i tried typing it in the mongo shell without success. can you please specify where the variable is to be created. thank you.

It is created in the mongo shell before calling the validation script.

progress: but testing individual query conditions i get an error:

my pipeline test:
db.movies.aggregate([ { $match: { imdb.rating: {$gte: 7 } } } ]).itcount()

errors with:
QUERY [js] SyntaxError: missing : after property id

am i missing something?

When your property name contains a dot like imdb.rating is must be between quotes. And as a safety I put all my properties in quotes, even $match and $gte included.

1 Like

thanks for that. worked great. passed lab.