Mongoose: mpromise (mongoose's default promise library) is deprecated, plug in your own promise library instead: http://mongoosejs.com/docs/promises.html
操作数据库的时候,老是提示:Mongoose: mpromise (mongoose's default promise library) is deprecated, plug in your own promise library instead: http://mongoosejs.com/docs/promises.html
增删改都没有问题,但是很影响排错。
解决办法:在连接数据库的时候,添加mongoose.Promise = global.Promise;
mongoose.connect(url, mongoOptions);
mongoose.Promise = global.Promise;
mongoose.connection.on('error', function (err) {
console.log('Mongo Error:' + err);
}).on('open', function () {
console.log('Connection opened');
});
Mongoose: mpromise (mongoose's default promise library) is deprecated, plug in your own promise library instead: http://mongoosejs.com/docs/promises.html的更多相关文章
- node.js开发错误——DeprecationWarning: Mongoose: mpromise
原文地址 使用mongoose进行数据库操作时,总是提示: (node:5684) DeprecationWarning: Mongoose: mpromise (mongoose's default ...
- mongoose报错:DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead
参考:mongoose报错:DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead mo ...
- Promise原理—一步一步实现一个Promise
promise特点 一个promise的当前状态只能是pending.fulfilled和rejected三种之一.状态改变只能是pending到fulfilled或者pending到rejected ...
- Promise的源码实现(完美符合Promise/A+规范)
Promise是前端面试中的高频问题,我作为面试官的时候,问Promise的概率超过90%,据我所知,大多数公司,都会问一些关于Promise的问题.如果你能根据PromiseA+的规范,写出符合规范 ...
- nginx 编译某个模板的问题./configure: error: SSL modules require the OpenSSL library. You can either do not enable the modules, or install the OpenSSL library into the system, or build the OpenSSL library stati
root@hett-PowerEdge-T30:/usr/local/src/nginx-1.9.8# ./configure --prefix=/usr/local/nginx --add-mod ...
- 【JavaScript进阶】深入理解JavaScript中ES6的Promise的作用并实现一个自己的Promise
1.Promise的基本使用 // 需求分析: 封装一个方法用于读取文件路径,返回文件内容 const fs = require('fs'); const path = require('path') ...
- promise不会被return触发, 一个promise对象中不会被Promise.reject触发
1. let a = new Promise((resolve,reject)=>{ return 23 }) a; // promise <pending> 2. let a = ...
- mongoose 报错:DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead
mongoose.set('useCreateIndex', true) // 加上这个
- MSDN Library for vs 2010安装及使用(MSDN Library)
VS2010正式版不再有单独的MSDN Library安装选项,VS2010的ISO安装光盘里已经包含有MSDN Library,只不过要手动安装,方法如下: 1.安装完VS2010后,在开始菜单中打 ...
随机推荐
- 「LuoguP4180」 【模板】严格次小生成树[BJWC2010](倍增 LCA Kruscal
题目描述 小C最近学了很多最小生成树的算法,Prim算法.Kurskal算法.消圈算法等等.正当小C洋洋得意之时,小P又来泼小C冷水了.小P说,让小C求出一个无向图的次小生成树,而且这个次小生成树还得 ...
- mysql的itcast笔记
1 课程回顾 自定义标签&编码实战 1)自定义标签步骤: 1.1 编写标签处理器类,继承SimpleTagSupport类,覆盖doTag方法 1.2 在WEB-INF目录下建立tld文件,在 ...
- Excel中导入到oracle使用merge into 差异性更新数据库
merge into temp1 ausing (select ID from (Select ID from temp1 ...
- iview组件select之默认展示label,并传空value做方法入参
要求: 默认查询操作日期在当日的数据:(打开页面时默认选中时间.全部) 后台约定:选定“全部”这个条件,传的值是空"" 综上:使用select选择框的v-model绑定数据,使用: ...
- linux c二级指针的内存分配和使用
#include <stdio.h>#include <stdlib.h>#include <string.h>#include <unistd.h> ...
- NOIP2014提高组 联合权值(距离为2的树形dp)
联合权值 题目描述 无向连通图 GG 有 nn 个点,n-1n−1 条边.点从 11 到 nn 依次编号,编号为 ii 的点的权值为 W_iWi,每条边的长度均为 11.图上两点 (u, v)(u, ...
- mui 关闭当前窗口
在提交表单的时候,我们都需要关闭表单.需要关闭当前打开的窗口. bit.alert('提交成功' + (result.category.needAudit ? ",请耐心等待管理员审核信息后 ...
- 再论c#获取存储过程返回值(包括SqlSugar)
其实这个问题好多年以前研究过: https://blog.csdn.net/xpnew/article/details/6909902 最近因为需要统计日结月结,给同事写了一套调用存储过程的代码.同时 ...
- Solr6.7 学习笔记(01) -- 目录结构
Solr解压后的目录结构 --contrib: Solr的一些扩展 --analysis-extras: 包含一些文本分析组件及其依赖 --clustering: 包含一个用于集群搜索结果的引擎 -- ...
- [Swift]Xcode实际操作
★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★➤微信公众号:山青咏芝(shanqingyongzhi)➤博客园地址:山青咏芝(https://www.cnblogs. ...