Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要检查(并采取适当的措施)是否刚刚创建了一个对象,或者一个已经存在的对象正在使用新值进行更新。有什么方法可以准确检查吗?
就在这里。新对象还没有 id,因此您可以检查该对象是否有 id。
Parse.Cloud.beforeSave("MyClass", function (request, response) { var object = request.object; if (!object.id) { // this is a new object } });