Chapter 1 Homework. Can't get any result


I’m stuck in the homework. I tried various combinations for the pipeline, and cannot get any result (once teh verification query db.movies.aggregate(pipeline).itcount() is entered, the cursor just get there blinking without any output.

I shortened the pipeline to var pipeline = [ {$match: { "imdb.rating": {$gte: 7}, "genres": { $nin: [ "Crime", "Horror" ] }}}] to test and still cannot get any output. I’m correctly connected to the database so I can’t figure out the issue

Please help

Did you use aggregations?

I can’t understand what do you mean. I’m using the syntax [ { $match: { field1: {value}, field2: {value} ...} } ]

The movies collection is inside a database called aggregations. Run the following code to switch to that database:
use aggregations

forgot this crucial step today. Thanks