3
我正在使用舊的解析SDK版本1.5.0和我的函數返回所有包括。 現在我試圖使用最新的SDK,並且函數僅返回主對象(在門和位置我只能得到「指針」)。解析雲代碼新的SDK包括子類不工作
下面是代碼:
Parse.Cloud.define("get_gates_for_user", function(request, response) {
var userId = request.params.userId;
var gateToUserQuery = new Parse.Query("GateUserJoinTable");
gateToUserQuery.equalTo("user", {
__type: "Pointer",
className: "_User",
objectId: userId
});
gateToUserQuery.include("gate");
gateToUserQuery.include("location");
gateToUserQuery.find({
success: function(results) {
response.success(results);
},
error: function(error) {
console.log(error.message);
response.error(ERROR_CODE_GENERAL_ERROR);
}
});
});
也許有關? http://stackoverflow.com/questions/33059768/parse-com-javascript-sdk-using-include-but-not-working – melpomene
是的似乎是相同的問題!此外,我嘗試使用JavaScript(在瀏覽器頁面上)的代碼,我可以得到所有的子類信息。 –
是的,和我的帖子一樣。我不明白爲什麼。有辦法做到這一點,但它出現的字典,不像'List' –