Unknown top level operator $not

I am trying to solve the homework assigment and I seem to be getting an error after running db.movies.aggregate(pipeline).itcount(). the error message is “errmsg” : “unknown top level operator: $not”.

Solved the issue. I stopped using $not and started using $nin instead since it was more suitable for my problem.