Problem with Lab $match : validateLab1(pipeline)

Hi! i composed the pipeline and i had the correct result, but now these are the problems that i have:

in the directory where i i saved the validateLab1.js, i run

> MongoDB Enterprise > load('validateLab1.js')


so i save in pipeline the aggregation.

now i run this and it hung up :

nothing happens…

Please help me!

I resolved, i did a mistake.

i run the connection to the cluster in other terminal window.

So now i did this :

in the directory where i saved the validateLab1.js i run the command :

mongo "mongodb://,," --authenticationDatabase admin --ssl -u m121 -p aggregations --norc

then :


then i saved the aggregation in var pipeline

at the end


@ Alessandro_65603

Please follow Forum guidelines and do not post answers or code examples here. I have edited your post accordingly. And glad you figured it out. Thanks.

Hi Guys,
Thank you for the guidelines about running Mongo from the same folder where we have saved the handouts.
In the explanation it wasn’t clear
Not everyone is a sysAdmin :wink:


i was following the same way of execution as you mentioned. but I’m getting the error as shown in attachment


problem solved.

the error “You aren’t returning the correct number of documents” was due the $count function was included in “pipeline”. after removing from pipeline it worked well
:slight_smile: :slight_smile: :slight_smile:

1 Like