解析服务器云代码保存后触发器

Rez*_*adi 2 parse-platform parse-cloud-code

云代码中的aftersave函数是在每次更新特定类的对象时调用还是仅在创建类的对象后调用?

ima*_*a97 5

afterSave云计算函数被调用每次创建或更新类的一个对象的时间。(持久化)在数据库中。

但是,如果您希望它仅在创建对象时触发,则应执行以下操作:

Parse.Cloud.afterSave('your_class_name', (request) => {

  if (!request.original) {
    // this means the object is just created

  } else {
    // this means it is an update to the object.


  }
});
Run Code Online (Sandbox Code Playgroud)