Can we update parse server 2.8 to 3.x. Our cloud code base is using backbone style reponse callbacks. Is this compatible with the new 3.x update. Specifically 3.1.2.
Our code base uses the old style success, error callbacks do we have to migrate all our code to promises or async wait as per the changelong
https://github.com/parse-community/parse-server/blob/master/CHANGELOG.md
As of Parse-server version 3 and above, Parse Server is using the Parse JS SDK version 2.0+.
So, you need to change all backbone styles to either:
for instance:
new Parse.Query('your_class_name')
.find({
success:function(result){}
});
should change to:
new Parse.Query('your_class_name')
.find()
.then((results)=>{})
.catch((error)=>{})
If you are inside of an async function, then you can do:
const asyncFunc = async() => {
try {
const results = await new Parse.Query('your_class_name').find();
// do something with the results here.
} catch (error) {
// do something with the error
}
}