[英]Parse trigger error, afterFind expect results to be returned in the promise
當我嘗試使用簡單的 afterFind 觸發器時出現錯誤。 我通過 back4app 使用 Parse Server v4.2.0
Parse.Cloud.afterFind('Device', async (req) => {
console.log(req);
});
但是應用程序崩潰並開始提示錯誤消息
afterFind expect results to be returned in the promise
我注意到兩件事:
我錯過了什么?
因為您使用的是async
,所以它期望 promise 解析為查詢結果。 你有兩個選擇:
await
,您可以從 function 中刪除async
:Parse.Cloud.afterFind('Device', (req) => {
console.log(req);
});
Parse.Cloud.afterFind('Device', async (req) => {
console.log(req);
return req.objects;
});
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.