1
votes

The following query with PARSE under Android:

        //user and targetUser are ParseUsers
    ParseQuery<ParseObject> query = ParseQuery.getQuery("UserConnection");
    query.whereEqualTo("fromUser", user);
    query.whereEqualTo("toUser", targetUser);

    query.findInBackground(new FindCallback<ParseObject>() {
      public void done(List<ParseObject> results, ParseException e) {
            if (results.size() > 0) { // entry for user-relation already exists
                //...   

            } else { // create new entry event/user
                //...

            }
      }
    });

only delivers an empty result when executing. When I query with only one restriction ("where equal to") I get results. I checked and there is a dataset that matches both restrictions (ParseUser user as "fromUser" AND ParseUser targetUser as "toUser"). Is there some restriction regarding the query of multiple (User) Objects in PARSE?

1

1 Answers

0
votes

If the fromUser and toUser columns are both of type Pointer<_User>, and you've confirmed that both user and targetUser are both ParseUser objects then the query should work.

Try logging the objectId of each user, and comparing that to what shows in the Data Browser in your Admin Dashboard to confirm a record will match.

It sounds like a data issue.