我们可以更新解析服务器2.8到3.x的我们的云代码库是使用主干风格效应初探回调。与新的3.x更新此兼容。具体来说3.1.2。
我们的代码库使用旧风格的成功,错误回调做,我们有我们的所有代码迁移到承诺或异步等待具体根据changelong
https://github.com/parse-community/parse-server/blob/master/CHANGELOG.md
作为解析服务器3及以上版本,解析服务器使用解析JS SDK 2.0以上版本。
所以,你需要将所有的骨干样式之一:
例如:
new Parse.Query('your_class_name')
.find({
success:function(result){}
});
应改为:
new Parse.Query('your_class_name')
.find()
.then((results)=>{})
.catch((error)=>{})
如果你是一个异步函数中,那么你可以这样做:
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
}
}
具有回购贡献者的代码有一个直接通话后迁移看见migration guide