如何在Cloud Code中关注用户链接?

Gab*_*man 5 parse-platform parse-cloud-code

在afterSave Cloud Code函数中如下:

Parse.Cloud.afterSave("Post", function (request) {

    var post = request.object;

    if (post.has('author')) {
        var author = post.get('author');  
        // author is a Link to a specific Parse.User   
    }

}
Run Code Online (Sandbox Code Playgroud)

我正在尝试获取Post的作者字段指向的Parse用户的电子邮件.

在上面的示例中,author最终包含以下内容:

{
    "__type":"Pointer",
    "className":"_User",
    "objectId":"413wgL9vf1"
}
Run Code Online (Sandbox Code Playgroud)

本质上,我想读取email指针指向的用户的属性.

我尝试过author.get('email'),但失败了,说"未定义".电子邮件在数据库中设置.

这样做的正确方法是什么?我应该使用链接中的objectId编写针对User类的查询,还是有更简单的方法?

Gab*_*man 0

事实证明我需要做的就是author.fetch().then(...)