Android Parse - ParseQuery with List equality condition for field / column

I use Parse and I just want to get all the records in my data class with a specific list in the "blah" field / column.

final ParseQuery<Data> query = ParseQuery.getQuery(Data.class);
query.whereEqualTo("blah", mSomeValueList);
query.setLimit(MAX_DATA_TO_SHOW);
query.orderByAscending("createdAt");
// Execute query for messages asynchronously
query.findInBackground(new FindCallback<Data>() {...});

I was hoping it would be so simple, but when I try to run the request, I get the following exception: com.parse.ParseException: for equality, a value is required instead of [value0, value1, ...]

How can I get List of Data objects that have this condition?

+4
source share
1 answer

You can always use whereEqualTowhereEqualTo

public ParseQuery<T> whereEqualTo(String key,
                                  Object value)
Add a constraint to the query that requires a particular key value to be equal to the provided value.
Parameters:
key - The key to check.
value - The value that the ParseObject must contain.
Returns:
Returns the query, so you can chain this call.,

There is also whereContainsAll, whereMatchesQuery, whereDoesNotMatchQueryetc.

, .

+1

All Articles