You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var fieldValue=req.object.get('MyNumericField'); //this holds the expected field value, already incremented.
var jsonBody = {};
jsonBody.object = req.object.toJSON();
jsonBody.object.className = req.object.className;
/*at this point, jsonBody.object has lost its actual current value, and its replaced by an IncrementOp with a value of 1.
var unmarshalled = JSON.parse(jsonBody.object);
this object is not the same as req.object.
var fieldValueb=req.object.get('MyNumericField'); returns IncrementOp, not value
*/
how should I properly marshall/unmarshall parse objects such that they maintain their integrity?
thanks
The text was updated successfully, but these errors were encountered:
AFAIK That's unfortunately not possible with the current SDK's. The beforeSave has the client 'operations' and not the full values. an afterSave would have the proper values.
Also, possibly fixable with the internals of the JSSDK, if the operations are stored differently than the values.
Can you please add all the info specified in the template? This is necessary for people to be able to understand and reproduce the issue being reported.
if I have a Numeric field and increment it using the sdk something like
and I have cloudcode something like:
Parse.Cloud.beforeSave("TestClass", function(request, response) {
how should I properly marshall/unmarshall parse objects such that they maintain their integrity?
thanks
The text was updated successfully, but these errors were encountered: