I have the cloud code below to save a custom object into the Parse.Installation object with which it is associated.
In the cloud code logs, I see that the Success callback is called, but when I check the Installation object in the Analysis browser, the User attribute is "undefined".
Any ideas?
Parse.Cloud.define("saveUserWithInstallationObj", function(request, response) {
var query = new Parse.Query(Parse.Installation);
query.equalTo("installationId", request.params.installationId);
query.first({
success: function(result) {
if(result){
var currentUser = new Parse.User({id:request.params.userId});
result.set("user", currentUser);
result.save(null, {
success: function(installation) {
console.log("******SAVED Installation object");
response.success();
},
error: function(e) {
console.log(e);
response.error(e.message);
}
});
}else{
}
},
error: function(error) {
}
});
});
source
share