In the function after the CloudSave cloud code:
Parse.Cloud.afterSave("Post", function (request) { var post = request.object; if (post.has('author')) { var author = post.get('author');
I am trying to get the Parse user email that the Post author field points to.
In the above example, author ends up containing:
{ "__type":"Pointer", "className":"_User", "objectId":"413wgL9vf1" }
Essentially, I want to read the email property of the user that the pointer points to.
I tried to do author.get('email') and it failed by saying "undefined". Email is installed in the database.
What is the right way to do this? Should I write a query regarding the User class using the objectId from the link, or is there an easier way?
source share