是否可以在 Parse Cloud Code AfterSave 中获取对象的先前值? [英] Possible to get previous value of object in Parse Cloud Code AfterSave?

查看:33
本文介绍了是否可以在 Parse Cloud Code AfterSave 中获取对象的先前值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 AfterSave 函数,它根据刚刚保存的对象的先前值更新其他内容.仅仅知道对象已经用 object.existed() 改变是不够的.

I have an AfterSave function that updates something else based on the previous value of the object that was just saved. Simply knowing that the object has changed with object.existed() is not enough.

有没有办法在不实施昂贵的解决方法和增加 API 调用次数的情况下获取对象属性的先前值?

Is there any way to get the previous value of an object's property without implementing a costly workaround and increasing the number of API calls?

是否可以在AfterSave 函数中获取对象的先前值?

Is it even possible to get the previous value of an object in the AfterSave function?

当我调用 object.previous("value") 时,我得到一个未定义的值.

When I call object.previous("value"), I get an undefined value.

推荐答案

不知道这是否有帮助,或者它是否会被认为成本太高的解决方法,但您可以向正在更新的对象添加一列存储原始列的先前值.这将允许您访问 AfterSave 函数中的先前值.

Don't know if this is helpful or if it would be considered too costly of a workaround, but you could add a column to the object that is being updated that stores the previous value of the original column. This would allow you to access the previous value in the AfterSave function.

这篇关于是否可以在 Parse Cloud Code AfterSave 中获取对象的先前值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆