Lab-$match Homework Answers doesn't match

Answers in the MCQ are 12,15,30 and 7
I ran the query in the below server. So i juct clicked a random answer and it was correct. Sadly the correct answer non of the above

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

Please help :slight_smile:


The server login is correct. But what do you mean when you say that you “clicked a random answer and it was correct”? And, while I don’t want you to post your pipeline here – that’s against Forum rules – I’m not at all sure what “query” you ran. If you can give me some more information, I’ll try to help. Good luck.

Thank You for the reply.Please see below screen shots fro more information

This is the answer i clicked

< deleted >

This is the answer they suggested

< deleted >

When i run the query in mongo i get

< deleted >

please help what i v missed


Ahh… I see what your problem is now. [FYI, I removed the screenshots just so that any other students don’t see them].

The correct answer will only be shown when you run ‘validate.Lab1.js’, which tests the answer returned by your pipeline and then gives you the correct value to put in the test. So the number you got is correct and, if you run your query through the validation script, you’ll see the correct answer.

Basically, the query itself does not give the correct answer for the test. The script changes the answer from the query to generate the test answer. HTH. Good luck.

Thanks for the explanation. It would be great if we can have steps how to run the js in the machine. because i got this error

Hi Sheshan, You need to Download Handouts in the lab, extract the files and now connect to the mongo server from the same folder where you have the validateLab1.js file. Then you can load the file without problems.
I hope this helps you.

Thanks @FranLpz and @Sheshan_22215
For solution how to validate lab js file

You need to give the full path of the file to load. Copy the content of the chapter1 from the downloads folder and paste it into the shared folder of vagrant.
while loading validateLab1.js give syntax like load(’/shared/validateLab1.js’)
it will show message as ‘true’