asynchronous等待node.js跳过第二个等待语句保存mongodb

我正在使用node.js ES6中等待asynchronous…

async insertIngot(body, callback) { console.log('*** ItemsRepository.insertIngot'); console.log(body); const data = await this.getItemsTest(); console.log('*** getItems ok'); items = data.items; let item = new Ingot(); item.ingotName = body.ingotName; item.formulaName = body.formulaName; item.items = items; await item.save(); return item; } 

第一个等待工作,然后跳过代码的其余部分,并引发错误:

(node:16612)DeprecationWarning:Mongoose:mpromise(mongoose的默认承诺库)已被弃用,请插入自己的承诺库: http ://mongoosejs.com/docs/promises.html

       

网上收集的解决方案 "asynchronous等待node.js跳过第二个等待语句保存mongodb"