Chapter 1: Lab $match (Solved)

Hi everyone, I’m trying to create the variable pipeline to do the homework and when I run de command I get 3 dots. What am I doing wrong?
Here is a schema of my command to create the variable:
var pipeline = [{ $match: {“field1”:{$gte: value1}, “field2”:{$nin:[“value1”,“value2”]}, “field3”:{$in:[“value1”,“value2”]}, “field4”:{$all:[“value1”,“value2”]}} }]:

I’ll leave here what worked for me in case it’s useful to someone else. I only had to take the var away and with that it worked.

1 Like

The 3 dots is the way the shell tells you that the command you are entering is not complete.

In your case, the colon at the end might be the culprint.

@steevej-1495 I forgot to say that y took the colon away too.
Thanks for the comment. :slightly_smiling_face:

I managed to get it to work by using an $and operator.

Only issue I have is that my query returns 24 documents instead of the 23 it should

I also got the answer 24. I log on the mongodb compass to check the every docs. It seems every document is right.

1 Like

I got 24 because I made a typo in genres (forgot the s)

oooo, I used “generes” …

You are right! We must use “Crime” instead of “Crimes”. l lost a lot of time because of this…