Parse.com包含保存时的相关字段数组

时间:2014-06-12 01:54:52

标签: javascript rest parse-platform

是否可以在保存中包含相关字段,即

save(null, {
    success: function(updatedObject) {
            // Is there a way to include another field which is an array of pointers either here or before save()?
    },
    error: function() {
        ...
    }
});

1 个答案:

答案 0 :(得分:0)

只有在查询某个项目时,才能使用include方法获取所包含的对象。

var query = new Parse.Query('myClass');
query.include('arrayOfPointersColumn');
query.first().then(function(result) {
  // you can access the full parse objects inside the result object.
  var otherObjects = result.get('arrayOfPointersColumn');
  console.log(otherObjects);
});