mongoose报错:(node:15689) DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead.

解决办法:

//连接数据库
mongoose.set('useCreateIndex', true) //加上这个
mongoose.connect(db, { useNewUrlParser: true })

mongoose报错:DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead.的更多相关文章

  1. mongoose报错:DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead

    参考:mongoose报错:DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead mo ...

  2. mongoose 报错:DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead

    mongoose.set('useCreateIndex', true)    // 加上这个

  3. [未解决]报错:DeprecationWarning: decodestring() is a deprecated alias since Python 3.1, use decodebytes()

    DeprecationWarning: decodestring() is a deprecated alias since Python 3.1, use decodebytes()

  4. 【PHP】php7.2报错The each() function is deprecated. This message will be suppressed on furthe

    php7.2以上 废除了 each()方法,项目中用到的地方会出现以下报错 The each() function is deprecated. This message will be suppre ...

  5. phpredis 报错 “Function Redis::setTimeout() is deprecated” 解决方法

    项目在本地开发过程中抛出异常: Function Redis::setTimeout() is deprecated 找到出错代码: <?php use Illuminate\Support\F ...

  6. Vivado_HLS 编译报错error: AP_STREAM macros are deprecated

    D:/vivado2018.3/Vivado/2018.3/common/technology/autopilot\ap_stream.h:62:2: error: AP_STREAM macros ...

  7. DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead extract-text-webpack-plugin 提取css报错

    深入浅出Webpack 1-5 使用pulugin extract-text-webpack-plugin 提取css报错 DeprecationWarning: Tapable.plugin is ...

  8. mybatis报错Mapped Statements collection does not contain value for com.inter.IOper

    首页 > 精品文库 > mybatis报错Mapped Statements collection does not contain value for com.inter.IOper m ...

  9. php报错日志:PHP Deprecated:Automatically populating $HTTP_RAW_POST_DATA is deprecated

    前几天将线上php服务升级到5.6.x版本后,php-error.log报出错误:PHP Deprecated: Automatically populating $HTTP_RAW_POST_DAT ...

随机推荐

  1. Win10永久版低价购买及激活工具使用说明

    目录 按 发展历程 用户界面 激活工具 按 Windows 10是由美国微软公司开发的应用于计算机和平板电脑的操作系统,于2015年7月29日发布正式版. Windows 10操作系统在易用性和安全性 ...

  2. redis 其他操作

    1.设定服务端密码 1.1.编辑 redis的配置文件 [root@centos7 ~]# vim /usr/local/redis/etc/redis.conf requirepass 123 # ...

  3. electron教程(番外篇一): 开发环境及插件, VSCode调试, ESLint + Google JavaScript Style Guide代码规范

    我的electron教程系列 electron教程(一): electron的安装和项目的创建 electron教程(番外篇一): 开发环境及插件, VSCode调试, ESLint + Google ...

  4. 「 优质资源20190409 」Java最新精选优质资源!

    资源导读 经过小编精心整理,java最新优质资源出炉 不想看书,可以看视频,比较生动有趣,好的视频教程是一个好老师! 资源来自于网络,请勿用于商业用途 资源目录 1.Java Spring 技术栈构建 ...

  5. 【java面试】数据库篇

    1.SQL语句分为哪几种? SQL语句主要可以划分为以下几类: DDL(Data Definition Language):数据定义语言,定义对数据库对象(库.表.列.索引)的操作. 包括:CREAT ...

  6. Iptables和Firewall-selinux

    一.Iptables防火墙 ---------- **三表五链:**三表: filter过滤表 nat转换表 mangle表五链: PREROUTING--->在进行路由选择前处理数据包 INP ...

  7. Maven 项目无法在Ecplise加进tomcat server

    当把用Maven项目 加进 tomcat server 时,出现 "There are no resources that can be added or removed from the ...

  8. 实验18:HDLC和PPP

    实验15-1:HDLC 和PPP 封装 Ø     实验目的通过本实验,读者可以掌握如下技能:(1) 串行链路上的封装概念(2) HDLC 封装(3) PPP 封装 Ø     实验拓扑 实验步骤n  ...

  9. 实验7:交换机IOS升级

    交换机IOS升级首先需要有IOS文件,如果没有备份原文件的话,可以找个同一版本的IOS来替代. 第一种方法:X-Modem 以前我曾经尝试过一种方法,就是当Flash被删除后,启动无法进入系统,可以用 ...

  10. SDL多线程显示更新窗口

    //初始化SDL2和创建一个窗口,并且将屏幕绘制成大红色 #include <iostream> extern "C" { #include <SDL.h> ...