0
在我的查詢中,如何訪問Parse
類中的對象? 像設置對象awayTeam
等於newAwayTeam
對象?解析雲碼訪問對象
喜歡的東西
CloseGameTime.set("awayTeam", "the newAwayTeam object");
原始代碼
Parse.Cloud.job("CloseGameTime", function(request, response) {
Parse.Cloud.useMasterKey();
var query = new Parse.Query("Score");
query.first({
success: function(CloseGameTime) {
var newAwayTeamVar = request.object.get("newAwayTeam");
CloseGameTime.set("isGameTime", "NO");
CloseGameTime.set("awayTeam", newAwayTeamVar);
CloseGameTime.save(null, {
success: function(CloseGameTime) {
response.success("Successfully updated the server.");
},
error: function(CloseGameTime, error) {
response.error("Could not save changes to the server.");
}
});
},
error: function(error) {
response.error("Could not find object.");
}
});
});
這看起來是正確的,但是當我運行這個(見更新的代碼段)我得到這個錯誤'無法用:類型錯誤:undefined'不能調用方法「得到」 – 2015-04-01 04:03:23