admin管理员组文章数量:1335825
I have problem with parse. I wrote cloud code
Parse.Cloud.afterSave(Parse.User, function(request) {
var user = request.object;
if( !user.existed() ) {
//all the times !user.existed() is true when I save user object
//also in signup is true
}
})
how can I make the inside if block run only if the user is new user?
I have problem with parse. I wrote cloud code
Parse.Cloud.afterSave(Parse.User, function(request) {
var user = request.object;
if( !user.existed() ) {
//all the times !user.existed() is true when I save user object
//also in signup is true
}
})
how can I make the inside if block run only if the user is new user?
Share Improve this question edited Dec 4, 2015 at 15:44 Sandra 3906 silver badges17 bronze badges asked Oct 4, 2015 at 8:07 user5303752user5303752 3-
What is
Parse.User
? – Axel Amthor Commented Oct 4, 2015 at 8:11 - this is parse user obejct – user5303752 Commented Oct 4, 2015 at 8:16
- 1 Ok I found that this is a bug developers.facebook./bugs/1675561372679121 – user5303752 Commented Oct 4, 2015 at 9:02
1 Answer
Reset to default 13This seems to be a Parse bug as of the latest Parse Javascript SDK (1.6.7).
https://developers.facebook./bugs/1675561372679121/
A quick work around (courtesy of Andrei Patru in the above thread):
var createdAt = request.object.get("createdAt");
var updatedAt = request.object.get("updatedAt");
var objectExisted = (createdAt.getTime() != updatedAt.getTime());
Just tested it and it works.
本文标签: javascriptParse requestobjectexisted() return falseStack Overflow
版权声明:本文标题:javascript - Parse request.object.existed() return false - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742400027a2467696.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论