[英]How to get if a code exist in parse.com?
我有一個問題,我在parse.com中的“ VerificationCode”數據庫中具有以下結構:
當有人在我的應用程序中插入代碼時,它會自動在“ attachedUser”列中添加本地存儲的用戶ID,我將其稱為“ ParseInstallObject.codigo2”,例如,我獲得該用戶的ID以在其中查看文本視圖等
問題是我想檢查用戶ID是否存在於解析中。 如果存在,則執行某項操作;如果不存在,則執行另一項操作。
我使用了在parse.com文檔中看到的代碼,但它始終表明該代碼存在。 這是我的代碼:
ParseQuery<ParseObject> query2 = ParseQuery.getQuery("VerificationCode");
query2.whereEqualTo("attachedUser", ParseInstallObject.codigo2);
query2.findInBackground(new FindCallback<ParseObject>() {
public void done(List<ParseObject> scoreList, ParseException e) {
if (e == null) {
comprobar.setText("exist");
comprobar2.setText("exist");
} else {
comprobar.setText("no exist");
comprobar2.setText("no exist");
}
}
});
如何查看用戶是否具有有效的密碼?
e==null means that the call was successfully completed by the server. It does not imply that the user exists or not.
if(e==null){
if(scoreList == null || scoreList.isEmpty()){
// The user does not exist.
}else{
// the user exists.
}
}else {
// You have an exception (like HTTPTimeout, etc). Handle it as per requirement.
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.