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

时间:2018-11-15 18:26:41

标签: parse-platform cloud-code

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

1 个答案:

答案 0 :(得分:0)

每次创建或更新该类的对象时,都会调用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.


  }
});

相关问题