我想知道在Shelves项目中创建自定义Drawable有什么区别:http://code.google.com/p/shelves/创建自定义View?
(节点:9540)UnhandledPromiseRejectionWarning:MongooseError:查询已执行:User.countDocuments({})在model.Query._wrappedThunk [as _countDocuments](D:\ Acadamic-LANGUAGE-PROJECTS \ Angular-Projects \ eShop-MEAN STACK \后端 \node_modules\mongoose\lib\helpers\query\wrapThunk.js:21:19) 位于 D:\Acadamic-LANGUAGE-PROJECTS\Angular-Projects\eShop-MEAN STACK\Back-End\node_modules\kareem\index .js:370:33 at processTicksAndRejections (internal/process/task_queues.js:77:11) (用于node --trace-warnings ...显示创建警告的位置)(节点:9540) UnhandledPromiseRejectionWarning:未处理的承诺拒绝。此错误的根源是在没有 catch 块的情况下抛出异步函数内部,或者拒绝未使用 .catch() 处理的 Promise。要在未处理的 Promise 拒绝时终止节点进程,请使用 CLI 标志--unhandled-rejections=strict(请参阅https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode)。(拒绝 ID:1)(节点:9540)[DEP0018] DeprecationWarning:未处理的承诺拒绝已被弃用。将来,未处理的 Promise 拒绝将会以非零退出代码终止 Node.js 进程。
这是我的代码......
router.get(`/get/count`, async (req, res) =>{
const userCount = await User.countDocuments((count) => count)
if(!userCount) {
res.status(500).json({success: false})
}
res.send({
userCount: userCount
});
Run Code Online (Sandbox Code Playgroud)
})