Get Comments exceeds 16MB and Atlas UI export issue

I am trying this piece of code:

    Variable v = new Variable("mid", "$_id");
    Bson commentsMatch = Aggregates.match(expr(eq("movie_id", "$$mid")));
    Bson sort = Aggregates.sort(Sorts.descending("date"));
    Bson lookup = Aggregates.lookup("comments",Arrays.asList(v), Arrays.asList(commentsMatch, sort), "comments");

    pipeline.add(lookup);

but it fails with this error:

Command failed with error 4568 (Location4568): 'Total size of documents in comments matching pipeline's $lookup stage exceeds 16793600 bytes'.

Also, in the Atlas UI when building this pipeline and exporting to Java or C# I get this error:

Error.captureStackTrace is not a function. (In 'Error.captureStackTrace((0,o.default)(u),h[t])', 'Error.captureStackTrace' is undefined)

But the same pipeline exports without issue to Python and Node. Here is the pipeline JSON:

[{$lookup: {
  from: 'comments',
  let: { "mid": "$_id" },
  pipeline: [
    {
      $match: {
        $expr: {
          $eq: ["$movie_id", "$$mid"]
        }
      }
    },

        {
      $sort: {"date": -1}
    }
  ],
  as: 'comments'
}}]

Hi, I’m experienced the same error.
Since match stage in lookup pipeline is

...
"$match": {
  "$expr": {
    "$eq": ["$movie_id", "$$mid"]
  }
}
...

initially, I’ve created this piece of code:

Bson exprMatch = Filters.expr(Filters.eq("$movie_id", "$$mid"));

but, launching GetCommentsTest, I’ve got this error:

com.mongodb.MongoCommandException: Command failed with error 168 (InvalidPipelineOperator): 'Unrecognized expression '$movie_id'' on server ...

When I’ve removed the $ on movie_id field, I’ve catched your same error.

Parsing pipeline with Document.parse method works

Bson exprMatch = Document.parse("{'$expr': {'$eq': ['$movie_id', '$$mid']}}");

But I would know why this filter does not

Bson exprMatch = Filters.expr(Filters.eq("$movie_id", "$$mid"));

Bye.

@fabritag I am facing the same issue, but I am not able to get it resolved using Document.parse either. Did someone found the solution for above issue?
" ```
com.mongodb.MongoCommandException: Command failed with error 168 (InvalidPipelineOperator): ‘Unrecognized expression ‘$movie_id’’ on server …"