With the help of a lot of documentation, and some other students’ attempts in this forum, I finally got a pipeline that works correctly in Compass. However, when I try to create a view in Compass, I get the “unauthorized” warning; and when I copy paste my pipeline to the mongo shell (i.e. db.movies.aggregate[pipeline here]), there are no errors, but it just simply produces no output. It takes the pipeline command, and then just returns the command prompt again, as if nothing happened. What could be the problem?
Most likely you are not using the appropriate database. Post output of the command db.
Next, output of show collections.
If the pipeline worked in Compass in should work in the shell.
Post a screenshot while running in the shell.
Since jexqq is class shared cluster we have no write access. We cannot create view, cannot create database, collection or even documents. However you should be able to run the pipeline and still obtain the lab answer.
Since you have no output and you have confirmed that it is the correct database and correct collection then the only thing is that your $match is too restrictive and that really no document matches. In the red box in the previous screenshot, we see part of the $match may be you can shared the part we do not see.
It looks like you are missing an opening and closing parenthesis because aggregate is a method (function) of the movies collection. The syntax should be
db.movies.aggregate( [ … stages of the pipeline … ] )
but you have
db.movies.aggregate[ … stages of the pipeline … ]
I just do not understand why it does not generate a syntax error.