Unrecognized parameter to $filter: limit MongoDB-Mongoose

I have the following error on my console:: Invalid $project :: caused by :: Unrecognized parameter to $filter: limit

The irony of this is that the documentation tells us that it exists and can be used.

This is my code

const docWorker = await _worker.aggregate([
    {
      $project: {
        credencial: {
          $cond: {
            if: {
              $eq: [{ $size: "$identificacionObra" }, 0],
            },
            then: false,
            else: {
              $cond: {
                if: {
                  $gte: [
                    {
                      $size: {
                        $filter: {
                          input: "$identificacionObra",
                          cond: {
                            $eq: ["$$credencial.estado", true],
                          },
                          as: "credencial",
                          limit: 1,  <--------- the limit parameter does not work
                        },
                      },
                    },
                    1,
                  ],
                },
                then: true,
                else: false,
              },
            },
          },
        },
      },
    },
    { $match: _match },
    { $sort: _sort },
    {
      $facet: {
        paginatedResults: [
          { $skip: req.query.page * req.query.limit - req.query.limit },
          { $limit: parseInt(req.query.limit) },
        ],
        totalCount: [
          {
            $count: "count",
          },
        ],
      },
    },
  ]);

Please help me, what did I do wrong?