【发布时间】:2017-09-22 03:56:12
【问题描述】:
问题描述
如果我创建一个关系并在其上使用 relation.add() 方法,则不会发生任何事情。
复制步骤
let Booking = Parse.Object.extend("Booking")
let bookingQuery = new Parse.Query(Booking)
bookingQuery.get(newBookingObject.id, {
success: booking => {
console.log("invites", invites)
// prints array of existing ParseObjects from another class
let relation = booking.relation("invites")
console.log(relation)
// prints new relation with key "invites" and parent "Booking"
relation.add(invites)
console.log(relation)
// prints exactly the same relation object as before - nothing changed
booking.save().then(res => console.log(res))
// an empty relation is added
},
error: error => console.log("error", error)
// no errors
})
预期结果
relation.add(arrayOfParseObjects) 应该将对象添加到关系中
实际结果
什么都没发生
【问题讨论】:
标签: parse-platform add parse-server relation