Javascript 解析云代码新SDK包含子类不工作

Javascript 解析云代码新SDK包含子类不工作,javascript,parse-platform,parse-cloud-code,Javascript,Parse Platform,Parse Cloud Code,我使用的是一个旧的parse SDK版本1.5.0,我的函数返回了所有包含项。 现在我尝试使用最新的SDK,函数只返回主对象(在门和位置上,我只得到“指针”) 代码如下: Parse.Cloud.define("get_gates_for_user", function(request, response) { var userId = request.params.userId; var gateToUserQuery = new Parse.Query("GateUserJoin

我使用的是一个旧的parse SDK版本1.5.0,我的函数返回了所有包含项。 现在我尝试使用最新的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);
    }
});
});
我最近开始使用Parse,所以我不太熟悉旧SDK版本的行为

但是,由于您使用的是云代码,.include()不能保证比.fetch()有显著的性能提升,因为代码在其基础设施上运行(这是访问相关Parse.Object的有文档记录的方式,因此他们无论如何都应该为此进行优化),因此以下操作应该有效:

var\=require('下划线');
var结果;
gatetUserQuery.find().then(函数(联接){
//将结果添加到范围更大的变量
//用于在其他函数中访问
结果=连接;
//承诺是美好的
var fetchPromissions=u2;.map(结果、函数(连接){
返回Parse.Promise.when([
join.get('gate').fetch(),
join.get('location').fetch()
]));
});
返回Parse.Promise.when(fetchPromises);
}).然后(函数(){
//相关指针应该用数据填充
答复.成功(结果);
});

我认为至少在SDK的当前迭代中,不是指针。

可能相关吗?是的,似乎是同一个问题!我还尝试了使用JavaScript(在浏览器页面上)的代码,我可以得到所有子类的信息。是的,和我的帖子一样。我不明白为什么。有一种方法可以做到这一点,但它作为一本字典出现,不像
List