0
CloudCode를 처음 사용하려고 시도하고 그것을 좋아합니다.구문 분석 : 완료된 경우에만 배열이 반환되는 복수 쿼리
전화 번호에 CloudCode를 전달하여 이미 전화 번호에 앱이 있는지 확인하는 iOS 앱을 작성 중입니다.
문제는 쿼리가 완료되기 전에 success 블록을 실행하는 것입니다. 마지막 쿼리가 있다면 얼마나 많은 쿼리가 있는지 알아야합니다. 나는 또한 이것을 보았다.
Parse.Cloud.define("processNumbers", function(request, response) {
Parse.Cloud.useMasterKey();
var phoneNumbers = request.params.phoneNumbers;
phoneNumbers.forEach(function(entry) {
var query = new Parse.Query(Parse.User);
//query.equalTo("username", entry);
query.find({
success: function(results) {
console.log("has app");
},
error: function() {
console.log("not found");
}
});
console.log(entry);
});
response.success(phoneNumbers);
});
배열에있는 내부 약속이 결과를 반환하는 쿼리 일 때 수행해야 할 다른 작업이 있습니까? 나는 .as (무언가)를 반환 할 때 작동하도록 할 수 있지만 중첩 된 약속을 추가 할 때는 작동하지 않습니다. http://stackoverflow.com/questions/35832955/parse-cloud-code-sub-queries-with-parallel-promises . 감사! –