我正在使用 Parse,我只想获取我的数据类中在我的“blah”字段/列中具有特定列表的所有条目。
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>() {...});
我曾希望它会这么简单,但在尝试运行查询时出现以下异常:com.parse.ParseException: equality needs a value instead of [value0, value1, ...]
如何获得具有这种情况的数据对象列表?
最佳答案
你总是可以使用whereEqualTo
whereEqualTo
public ParseQuery<T> whereEqualTo(String key,
Object value)
Add a constraint to the query that requires a particular key's 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.,
还有一个whereContainsAll
,whereMatchesQuery
,whereDoesNotMatchQuery
,等等。
有关详细 文档,请参阅此 link
希望对您有所帮助。
关于Android Parse——具有字段/列列表相等条件的ParseQuery,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27474854/