Skip to content

$notInQuery, $dontSelect doesn't work with match in aggregate query #4842

Closed
@newdev7

Description

@newdev7

I have one class in which I'm storing user details. In other class I'm storing the messages which is sent and received by the user and every row in the message class has a pointer which points to the receiverId user.

I'm using aggregate to get the unique receiver ids in the message class. For that I'm using some condition that has to satisfy in that corresponding user row.

For e.g.,

Message table has columns userId, receiverId, userData(pointer points to the user data of receiverId), etc.,

User table has columns userId, List1, List2, etc.,
Using aggregate, I'm trying to get the unique values of receiverId in which the given userId must not be in the List1 of receiverId's row.

curl -X GET -H "X-Parse-Application-Id:appID" -H "X-Parse-Master-Key: masterKey" -H "X-Parse-REST-API-Key: apiKey" -G --data-urlencode 'match={"userId":"abcde_12345","userData":{"$notInQuery":{"where":{"List1":"abcde_12345"}},"className":"userClass"}}' -G --data-urlencode 'group={"object":{"userId":"$userId","receiverId":"$receiverId"}}' https://YOUR.PARSE-SERVER.HERE/parse/aggregate/messageClass

For this query, it returns empty row only even if the userId is not in the receiverId's List1.

If I remove, the userData(which contains $notInQuery (or) $dontSelect) from the above query, it returns the values

curl -X GET -H "X-Parse-Application-Id:appID" -H "X-Parse-Master-Key: masterKey" -H "X-Parse-REST-API-Key: apiKey" -G --data-urlencode 'match={"userId":"abcde_12345"}' -G --data-urlencode 'group={"object":{"userId":"$userId","receiverId":"$receiverId"}}' https://YOUR.PARSE-SERVER.HERE/parse/aggregate/messageClass

results:[{object:{userId:abcde_12345, receiverId: abcde_54321},object:{userId:abcde_12345, receiverId: edcba_54321},object:{userId:abcde_12345, receiverId: cdeba_34521}}]

Is $notInQuery, $dontSelect not to be used with match in aggregate query by design or is this a bug?

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions