parse-server
parse-server copied to clipboard
relation.add() not working
Issue Description
If I create a relation and use the relation.add() method on it nothing happens.
Steps to reproduce
` 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
}) `
Expected Results
relation.add(arrayOfParseObjects) should add objects to relation
Actual Outcome
nothing happens
Environment Setup
-
Server
- parse-server version (Be specific! Don't say 'latest'.) : 2.5.3
- Localhost or remote server? (AWS, Heroku, Azure, Digital Ocean, etc): Localhost
-
Database
- MongoDB version: 3.4
- Localhost or remote server? (AWS, mLab, ObjectRocket, Digital Ocean, etc): Localhost