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
Create one object TestObject with single value with given beforeSave trigger.
beforeSave Trigger creates a pointer field if not available
Fetch same object and try to change non_pointer key and save
BeforeSave trigger doesn't find old pointer field and recreated new pointer field.
exports.beforeSaveTestObject = request => {
console.log('before Save test Object');
var obj = request.object;
console.log(obj);
console.log(obj.get('point'));
if (obj.get('point')) {
return;
}
console.log('point not found');
var TestObject1 = Parse.Object.extend('TestObject1');
var newObj = new TestObject1({'key1': 1});
return newObj.save().then((newObj) => {
obj.set('point' , newObj);
});
}
Logs/Trace
Found a pointer column not in the schema, dropping it. TestObject point
Found a pointer column not in the schema, dropping it. TestObject point
before Save test Object
ParseObject { _objCount: 0, className: 'TestObject', id: 'w93hLKA3VZ' }
undefined
point not found
The text was updated successfully, but these errors were encountered:
I did investigated this issue I found that any schema validation is done before beforeSave. For new objects schema is created during this step. If we add any field to beforeSave that is never updated in schema. I verified in mongo database SCHEMA table.
If we add schema validation after beforeSaveTrigger ran this works fine.
For implementation related questions or technical support, please refer to the Stack Overflow and Server Fault communities.
Make sure these boxes are checked before submitting your issue -- thanks for reporting issues back to Parse Server!
Environment Setup
Steps to reproduce
Logs/Trace
The text was updated successfully, but these errors were encountered: