Skip to content

or queries with 2 relation queries (same one, just different conditions) returns 0 objects #1259

Closed
@aryelevin

Description

@aryelevin

For implementation related questions or technical support, please refer to the Stack Overflow and Server Fault communities.

Make sure these boxes are checked before submitting your issue -- thanks for reporting issues back to Parse Server!

Or queries with 2 relation queries (same one, just different conditions) returns 0 objects.
if i run one of the queries alone, i get the objects, so its a issue on the logics somewhere.

Environment Setup

AWS elastic beanstalk
Server v2.2.2

Steps to reproduce

    PFQuery *balanceQuery1 = [[[PFUser currentUser] relationForKey:@"credit_balance"] query];
    [balanceQuery1 whereKey:@"expired" equalTo:@NO];
    [balanceQuery1 whereKey:@"expiration_date" greaterThan:[NSDate date]];
    PFQuery *balanceQuery2 = [[[PFUser currentUser] relationForKey:@"credit_balance"] query];
    [balanceQuery2 whereKeyDoesNotExist:@"expired"];
    [balanceQuery2 whereKeyDoesNotExist:@"expiration_date"];

    PFQuery *balanceQuery = [PFQuery orQueryWithSubqueries:@[balanceQuery1, balanceQuery2]];
    [balanceQuery findObjectsInBackgroundWithBlock:^(NSArray * _Nullable objects, NSError * _Nullable error) {
        objects.count == 0!!!
    }];

Logs/Trace

None

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