Trying to create a variable for an aggregation framework

Hi @Ramone_Granston,

You are missing {} in your syntax after you declared $match in your aggregation pipeline. The syntax will be something like this:

db.movies.aggregate( [ { $match: { ... } } ])

Also, since you are creating a variable, you don’t need to mention db.movies.aggregate. You can simply do:

var pipeline = [ { $match: { ... } } ]

Let us know if there are any doubts around this. Feel free to reach out for anything else as well.

Regards,
Satyam

2 Likes

Thank you, it worked appreciate the assistance

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.