MongoError: unknown top level operator: $in. If you have a field name that starts with a '$' symbol, consider using $getField or $setField

I have function like this that returns the query:
function getMovieFilterQuery(filters = {}){
  const query = {}

  if (filters.moviesIds !== undefined) {
      query.movieId = { $in: filters.movieIds };
    }

  return query;
}