In a beforeSave hook, I want to get the state of an object before updating. In this particular case, this means that the user will not be able to change his choice after creating it. The pseudocode looks something like this:
If (user has already voted) { deny; } else { accept; }
And the code that I still have is:
Parse.Cloud.beforeSave('votes', function(request, response) { if (!request.object.isNew()) {
But request.object is the state of the object with the update already applied.
Please note that the βvotesβ object is created separately, so this does not allow you to insert, but not an update, itβs not enough. I need to know if a given field is set in the database.
jgm
source share