是否可以在云代码中进行嵌套查询?
我希望能够做类似的事情
var adList = [];
var query2 = new Parse.Query("QR");
var query = new Parse.Query("Campaigns");
query.equalTo("isFeatured", true);
query.find({
success: function(results) {
for (var i=0; i<results.length; i++){
var ad = [];
ad.push(results[i].get("Type")); //Adds "Type" to the ad array
ad.push(results[i].id); //gets the objectID and appends it to the arrayy
//second INNER QUERY
query2.equalTo("abc", true);
adList.push(ad);
query2.first({
success: function(results){
adList.push(5);
},
error: function(){
response.error("inner fail");
}
});
}
response.success(adList); //adds all ad arrays to adList array
},
error: function(){
response.error("failed");
}
});
我试过这样做,但内部查询永远不会执行。为什么?