You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a class, ClassA, that I'm trying to query for. I want to exclude all objects that exist as pointers on the results of a ClassB query. In my case, the classB query finds all objects where the requesting user is attached as the User pointer on the object as well. There is no way to use doesNotMatchKeyInQuery when the key I'm trying to match against is a pointer.
As a test to make sure you can use "objectId" as a key, I added a separate field and manually moved some of the objectIds of the ClassA objects to that field, and using that field as a string works fine. However, that would mean I'd need to duplicate data in order to perform this query. The only other solution I've found, which is far less efficient, is to perform the classBQuery, manually extract all the objectIds into an array, and use a notContainedIn query parameter on classAQuery, though this has bad scaling issues.
I think when queryKey in doesNotMatchKeyInQuery is a pointer, and key is a string, it should compare the objectId of the queryKey result instead of the full result.
Steps to reproduce
classAQuery = new Parse.Query("ClassA");
classBQuery = new Parse.Query("ClassB");
classBQuery.notEqualTo("User", request.user);
classAQuery.doesNotMatchKeyInQuery("objectId", "ClassA", classBQuery);
Since the "ClassA" key on ClassB objects is a pointer, no results match, thus non are excluded.
Expected Results
I want all objects that are not stored as pointers on the objects from the result of the ClassB query
Actual Outcome
No objects are excluded since a pointer doesn't match a string
Environment Setup
Server
parse-server version (Be specific! Don't say 'latest'.) : 2.6.5
Operating System: Standard using AWS parse-server setup
Hardware: Standard using AWS parse-server setup
Localhost or remote server? (AWS, Heroku, Azure, Digital Ocean, etc): local or AWS
The text was updated successfully, but these errors were encountered:
This should be fixed by #4308 but I'm unfortunately unable to fix the test for doesNotMatchKeyInQuery until I get home from my travels. Feel free to give it a stab if you have the time and knowledge.
Issue Description
I have a class, ClassA, that I'm trying to query for. I want to exclude all objects that exist as pointers on the results of a ClassB query. In my case, the classB query finds all objects where the requesting user is attached as the User pointer on the object as well. There is no way to use
doesNotMatchKeyInQuery
when the key I'm trying to match against is a pointer.As a test to make sure you can use "objectId" as a key, I added a separate field and manually moved some of the objectIds of the ClassA objects to that field, and using that field as a string works fine. However, that would mean I'd need to duplicate data in order to perform this query. The only other solution I've found, which is far less efficient, is to perform the classBQuery, manually extract all the objectIds into an array, and use a
notContainedIn
query parameter on classAQuery, though this has bad scaling issues.I think when
queryKey
indoesNotMatchKeyInQuery
is a pointer, andkey
is a string, it should compare the objectId of thequeryKey
result instead of the full result.Steps to reproduce
Since the "ClassA" key on ClassB objects is a pointer, no results match, thus non are excluded.
Expected Results
I want all objects that are not stored as pointers on the objects from the result of the ClassB query
Actual Outcome
No objects are excluded since a pointer doesn't match a string
Environment Setup
The text was updated successfully, but these errors were encountered: