I am looking to combine two parse queries into one which satisfies an 'OR' condition. How do I achieve this? The docs say that I need a list of parse queries but I am not very sure how to do that ? Here is my code :
ParseQuery<ParseUser> numberQuery = ParseUser.getQuery();
numberQuery.whereNotEqualTo("objectId", currentUser.getObjectId());
numberQuery.whereContainedIn("phoneNumber", values);
ParseQuery<ParseUser> emailQuery = ParseUser.getQuery();
emailQuery.whereNotEqualTo("objectId", currentUser.getObjectId());
numberQuery.whereContainedIn("email", values);
ParseQuery<ParseUser> superQuery = ParseUser.getQuery();
superQuery.or
How do I complete this query and get the 'OR' of the two in superquery ? Thanks
Okay I figured it out myself. To create a list you use
List<ParseQuery<ParseUser>> queries = new ArrayList<ParseQuery<ParseUser>>();
and then
queries.add(q1);
queries.add(q2);
and so on. And then you use
ParseQuery<ParseUser> superQuery = ParseUser.getQuery();
ParseQuery.or(queries);
to get the final combined query.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With