0
我有幾個約束條件的查詢:如何使用ParseQuery對同一個數據庫列執行OR查詢?
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");
[Multiple Combined「或」使用Android分析的查詢「的可能重複(http://stackoverflow.com/questions/28892973/multiple-combined-or-queries-using-android-parse) – john16384