Distinct query ParseError: Invalid aggregate stage 'hint'

I’ve tried running a distinct query per documentation but get this error.

ParseError: Invalid aggregate stage 'hint'

What can be wrong here? Here is my query.

      const qSrcTable = new Parse.Query(srcTable);
      qSrcTable.equalTo("name", name);
      qSrcTable.distinct("score");
      const rSrcTable = await qSrcTable.find({ useMasterKey: true });
      console.log("result is", rSrcTable);

I also tried it this way but got the same error:

      const qSrcTable = new Parse.Query(srcTable);
      qSrcTable.equalTo("name", name);
      const result = await qSrcTable.distinct("score");
      console.log("result is", result );

Thank you

I found another way to achieve a distinct count using aggregate.

const pipeline = [
      {
        $group: {
          _id: `$name`,
          uniqueCount: {
            $addToSet: `$score`,
          },
        },
      },
      {
        $project: {
          _id: 1,
          sum: {
            $size: "$uniqueCount",
          },
        },
      },
    ];
    const qSrcTable = new Parse.Query(`${srcTable}`);
    const rSrcTable = await qSrcTable.aggregate(pipeline);

This outputs an array with ids and unique counts in a single object. [{id: objectId, sum: uniqueCount}, {id: anotherObjectId, sum: anotheruUniqueCount}]