我不知道问题是什么。它不断返回一个空数组。也就是说,movieIds 始终为空。
function getMoviesInCinema(theCinema){
var cinema = theCinema;
var query = new Parse.Query("showing");
var movieIds = [];
query.equalTo("cinema", {
__type: "Pointer",
className: "Cinema",
objectId: cinema
});
query.find().then(function(results) {
if(results.length > 0){
for (var i = 0; i < results.length; i++) {
movieIds.push(results[i].get("movie"));
}
}
else{
console.log("Could be an error");
}
});
return movieIds;
}