Ticket Projection, npm test -t projection fails

Can’t seem to figure out what’s wrong with my code:

here’s the error:

if i used the const countryList = ["Russia","Japan","Mexico"] as the $in operator’s value, i get this error:

Need help, how do i solved this?

One thing I see but I am not sure it will fix your problem. The comment say do not put a limit but your code dtill has a limit (1).

Any reason your let cursor is outside the try block?

1 Like

@steevej-1495 Hey thanks for the reply, the cursor was already declared upon downloading the course materials, the only code i put was the argument inside the movies.find() which is:

{countries: {$in: countries}},
        {projection: {title: 1}}
1 Like

Even though this reply is probably too late for you @learner1283 but it may help someone in the future so I’m still posting it

  1. remove countryList = [“Russia”,“Japan”,“Mexico”]
  2. change {countries: {$in: countryList}} to {countries: {$in: countries}},
1 Like

@Joan_84795 Thanks! although i already passed the course 2 weeks ago, still thank you! :slight_smile:

1 Like