Distinct doesn't seem to work as documentation indicates

curl -X GET \
  -H "X-Parse-Application-Id: ${APPLICATION_ID}" \
  -H "X-Parse-Master-Key: ${MASTER_KEY}" \
  -H "X-Parse-REST-API-Key: ${REST_API_KEY}" \
  -G \
  --data-urlencode 'where={"playerName":"Sean Plott"},distinct=score' \
  https://YOUR.PARSE-SERVER.HERE/parse/aggregate/GameScore

Doesn’t seem to work correctly.

For example, when I query:

curl -X GET \
-H "X-Parse-Application-Id: xxxx" \
-H "X-Parse-Master-Key: xxxx" \
-G \
--data-urlencode "distinct=email" \
http://localhost:1337/aggregate/notification

Everything works correctly, however the moment I add where:

curl -X GET \
-H "X-Parse-Application-Id: xxxx" \
-H "X-Parse-Master-Key: xxxx" \
-G \
--data-urlencode "where={\"email\":\"[email protected]\"},distinct=email" \
http://localhost:1337/aggregate/notification

I get error:

{
    "code": 1,
    "message": "Internal server error."
}

Did I mess something up or there is a problem?

Thanks.

I couldn’t get distinct working, perhaps someone can help me out with this. However I found different way of achieving the same:

curl -X GET \
-H "X-Parse-Application-Id: xxxx" \
-H "X-Parse-Master-Key: xxxx" \
-G \
--data-urlencode "pipeline=[{\"match\":{\"date\":{\"\$lte\":\"2022-01-20T01:00:00.000Z\"}}},{\"group\":{\"objectId\":\"\$email\"}}]" \
http://localhost:1337/aggregate/notification

Basically match is to filter out records that I’m interested in, then group by email, resulting unique list of emails.

Above solution no longer works, at least as of version: mongo 5.0.14 & parse 6.2.0