I am using Parse Cloud code hooks (beforeSave). My object has a relation and I need to know which objects where added to this relation. My problem is exactly the same than here. I want to be able to do this :
var op = myObject.op('toto');
//Get all add op in relation toto
var added = op.added();
//Get all remove op in relation toto
var deleted = op.removed();
added.forEach(function(pointer) {
//Do something with pointer
//If you need value on pointer
pointer.fetch(function(objectFetched) {
//Do something with object
});
});
}
But that is not working anymore because
Result: TypeError: Object [object Object] has no method 'added'
How can I do now to know which objects was added to the relation ?