简体   繁体   中英

{“code”:101,“error”:“object not found for update”} Parse.com Javascript SDK

I'm trying to update certain column value of my class matching the objectId of the class , Here is my code below

var GameScore = Parse.Object.extend("Address");
var query = new Parse.Query(GameScore);

query.equalTo("objectId", "xxxx");
query.first({
  success: function(object) {    
   alert(JSON.stringify(object));
    object.set("address","kkkkkk");
    object.save();
  },
  error: function(error) {
    alert("Error: " + error.code + " " + error.message);
  }
});

Now in the success function i get the row data for the given objectId, But the object.set and object.save alone not working , please advice what is gone wrong here.

I get "{"code":101,"error":"object not found for update"}" error in the reponse.

Thanks in advance :)

Check both class level permission and object level(ACL) permission and make sure client have permission to update the object.

Also note that, All class and object have their own permission.

 var acl = new Parse.ACL(); acl.setPublicWriteAccess(true); acl.setPublicReadAccess(true); acl.setWriteAccess(user.id, true); model.setACL(acl); 

Is a problem with ACLs. With this you can solve it

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM