add方法会替换当前数组中全部内容,而不是在数组末尾增加一个值

代码如下

    let post = AV.Object.createWithoutData('Post', id)
    let comment = new AV.Object('Comment')
    let text = '123'

    comment.set('text', text)
    post.add('comments', comment)
    post.save().then(function(res){
        console.log(res.toJSON())
    }).catch(function(error){
        console.log(error)
    })

返回的数组中永远只有一条数据

[
{
    "__type": "Pointer",
    "className": "Comment",
    "objectId": "58fda8be8d6d8100589bc973"
}
]

不知道是不是我使用方法有问题?

你发的这个链接打不开?我想看看你的例子

我刚刚又试了一下,如果add的是字符串就正确,是pointer类型就只有一个。