Error when running test for Projection Ticket

Hi, right now i’m completing the MongoDB for JS Developers, in the projection ticket, which it has two test, i’m using the $in operator to look for movies in an array, and the test pass, but when i go to the status page to get the code i’m getting the following error:

UnhandledPromiseRejectionWarning: MongoError: $in needs an array

could anybody give me a hand?

I appreciate it, Thanks

Two scenarios can cause this issue.

  1. Some documents do not have the queried field or the queried field is not an array. Documents must be filtered out by the aggregation.
  2. The parameter received in the API is not an array and it should be transformed to an array before running the aggregation.