I am having a hard time doing something that should be simple. I must be missing something obvious. In Parse.com cloud code, I have a pointer (p) to an object in a Class (myClass). How can I get hold of the object in myClass, using the pointer (p)?
Searching the net makes me think I should be using fetch().
But however I tried failed. It seems like my fetch is just ignored.
I have used variations of this code pattern, all with the same failing result:
anObject.get("pointer").fetch()
{
}
for example with:
console.log("SIGNAL--BEFORE");
anObject.get("pointer").fetch({
success: function(myObject) {
console.log("ALL--OOKK");
}
});
console.log("SIGNAL--AFTER");
I never see the "ALL--OOKK" in the logs. Though I can see both "SIGNAL--BEFORE" and "SIGNAL--AFTER".
I have verified that anObject.get("pointer") is a valid objectId, so the problem has to be in the way I use fetch.
You are almost there. You need to pass a success function to the function fetch().