Chapter 1 homework - found just 9 documents

English isn’t my first language, so maybe I didn’t understand something, but my $match query from the first homework got only 9 documents…
I’ve read the especifications a ton of times, but I couldn’t figure out what I did wrong :frowning_face:

It will be much easier to help you if you show pipeline you are using.

UPDATE Sorry, moderators ask not to post any code here, so you sould not post pipline

Okay, I did it, after some hours of thinking and studying I finaly found the solution, I just can’t post it here.
But now my problem is… I don’t know how to load the validator file :sob:
I used the command but it didn’t find the file, I tried using the full path to the file: D:\university\m121\validateLab1.js but it gave me an error

I think i found reason of your problem, Miguel_69790. You can`t use multiple conditions on same field in query without $and / $or. For example {$match: { field1:“B”, field1:“C”} } will match only { a:“C” } and skip field1:“B”.

Pay attention, that you need “English” and “Japanese”

@Miguel_69790

Notice that the instructions for Lab - $match tell you

Load validateLab1.js into mongo shell

then run in the shell

load('validateLab1.js')

and finally

And run the validateLab1 validation method
validateLab1(pipeline)

Give that a try and post back here if you still have questions. Good luck.

Thanks @DHz, I actually had to put the full path to the file, but I couldn’t use the backslash “”, so it worked after i changed it to the forward slash “/” in the path, I completed the first week for m121 already, so, thanks!