我有几个约束的查询:
ParseQuery < ParseObject > requestsQuery = ParseQuery.getQuery(ParseConstantsUtil.CLASS_REQUEST);
requestsQuery.whereContains(ParseConstantsUtil.REQUEST_AUTHOR, currentUser.getObjectId());
requestsQuery.whereEqualTo(ParseConstantsUtil.REQUEST_STATUS, "Approved");
requestsQuery.whereEqualTo(ParseConstantsUtil.REQUEST_STATUS, "Rejected");
requestsQuery.whereEqualTo(ParseConstantsUtil.REQUEST_READ, false);
try {
List < ParseObject > requestsList = requestsQuery.find();
return listSize(model, requestsList);
} catch (ParseException e) {
e.printStackTrace();
}
其中一个约束恰好与我数据库中的同一列相关:
requestsQuery.whereEqualTo(ParseConstantsUtil.REQUEST_STATUS, "Approved");
requestsQuery.whereEqualTo(ParseConstantsUtil.REQUEST_STATUS, "Rejected");
以上似乎不起作用。如何使用 ParseQuery 对同一数据库列进行 OR 查询?
requestsQuery.whereEqualTo(ParseConstantsUtil.REQUEST_STATUS, "Rejected" || "Approved");