【发布时间】:2018-08-02 09:00:36
【问题描述】:
给 Mongo 使用 ES6 promiselibrary 的指令, 使用此代码:
mongoose.Promise = global.Promise;
但我仍然收到以下错误:
(node:17264) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): ReferenceError: done is not defined
(node:17264) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
为什么会出现此错误,我该如何解决?
【问题讨论】:
-
我首先要查找您在哪里使用
done- 这是未定义的 - 您认为done是什么?
标签: javascript mongodb cmd promise es6-promise