函数返回null,不应用等待结果
我在post方法中使用以下功能。我使用async-await,但是在post路由内调用该函数时,在transferAmount totalBalance中未更新。该函数的返回不正确。我需要指导,以便它返回具有更新值的对象。
async function transferAmount(fromAccountId, toAccountId, amount) {
const session = await mongoose.startSession();
const opt...