Every Parse Installation object instance in my Parse database has a pointer to a specific user. I have a background job that runs for every user, and what I want to do in this part of the background job is to set the respective user Installation's channel property to ["yesPush"], for push notification targeting purposes.
The way I figured I would do it is by querying for the specific Parse.Installation instance, and then setting its channels property. This doesn't seem to be working however. I'm trying to follow the guidelines in the Parse Cloud Code Docs, but it's either not the correct use case, or I'm not following it correctly.
Code:
var installationQuery = new Parse.Query(Parse.Installation);
installationQuery.equalTo('userId', parentUser);
installationQuery.find().then(function(results) {
return Parse.Object.set('channels', ["yesPush"]);
});
parentUserset? why are you using areturncall inside your find? Why are you usingfindinstead offirstif you expect at most 1 match? Why aren't you callingset()on the actual object itself? Why aren't you callingsave()orsaveInBackground()? - Timothy WaltersparentUseris an argument called by the encompassing function, it's used in different parts of the fxn without any problems, so I don't think thats the issue. I thought a return had to be used there, and usingfindinstead offirstwas a silly mistake. How would I callset()on the object? - Ghobs