不多说,旧版本使用

db.addUser("root","root")

新版本使用这句会出现这个错误提示

TypeError: db.addUser is not a function : @(shell):1:1

新版本用的是

 db.createUser(
  {
    user: "test",
    pwd: "test",
    roles: [ { role: "userAdmin", db: "test" } ]
  }
)

TypeError: db.addUser is not a function : @(shell):1:1 ——mongoDB创建新用户名密码的方法的更多相关文章

  1. mongodb 添加用户报错TypeError:db.addUser is not a function (mongodb3.4.1)

    1:问题如下: 原因是 新版的MongoDB已经不支持addUser方法了. 改成createUser了. 使用方法如下    2:具体解释一下db.createUser()方法的用法   定义: 创 ...

  2. TypeError: window.open is not a function

    想必大家现在都已经到家了,而苦逼的我还要坐在办公室混拿微薄的工资,技不如人,平常不努力给自己充电,年终一毛钱都没多给.不说这扫兴的话题了,在这给同样在苦逼坚守岗位的同志们节日的问候,新的一年,好运连连 ...

  3. db.students.batchInsert is not a function :@(shell):1:1

    按照<mongdb权威指南>当使用version 3.4.1版本的mongodb,其中使用batchInsert函数进行对students集合进行批量插入 db.students.batc ...

  4. mongodb3.0 db.addUser报错

    > db.addUser("ydkt","ydkt") --19T09:: E QUERY TypeError: Property 'addUser' o ...

  5. Meteor错误:TypeError: Meteor.userId is not a function

    问题描述: 浏览器console提示错误TypeError: Meteor.userId is not a function. 原因分析: 通过查看Meteor API文档,可知该函数由包accoun ...

  6. extjs之TypeError: d.read is not a function解决方案

    在创建如下代码时报出此错:TypeError: d.read is not a function Ext.define('shebyxgl_sheb_model', { extend: 'Ext.da ...

  7. TypeError: value.getTime is not a function (elementUI报错转载 )

    "TypeError: value.getTime is not a function" 2018年07月02日 16:41:24 leeleejoker 阅读数:2091 标签: ...

  8. TypeError: Buffer.alloc is not a function

    错误信息:TypeError: Buffer.alloc is not a function 截图如下: 解决办法(依次从上往下执行): sudo npm cache clean -f sudo np ...

  9. mongoDB数据库插入数据时报错:db.collection is not a function

    nodejs连接mongodb插入数据时,发现mongoDB报错:db.collection is not a function.解决方法: 1.npm下载mongodb2.x.x版本替换3.x.x ...

随机推荐

  1. sql server update+select(子查询修改)20190304

    if OBJECT_ID('tempdb..##t2') is not null drop table ##t2;create table ##t2( a int, b int, c datetime ...

  2. Spring Data Redis入门示例:Hash操作(七)

    将对象存为Redis中的hash类型,可以有两种方式,将每个对象实例作为一个hash进行存储,则实例的每个属性作为hash的field:同种类型的对象实例存储为一个hash,每个实例分配一个field ...

  3. python爬取网页图片

    # html:网页地址 def getImg2(html): soup = BeautifulSoup(html, 'html.parser') href_regex = re.compile(r'^ ...

  4. 06网络通信udp-tcp、正则

    一. udp网络程序 1.    udp网络程序-发送数据 1)创建客户端套接字 2)发送/接收数据 3)关闭套接字 from socket import * # 1. 创建udp套接字 udp_so ...

  5. 启发式合并CSU - 1811

    F - Tree Intersection CSU - 1811 Bobo has a tree with n vertices numbered by 1,2,…,n and (n-1) edges ...

  6. restframework框架之认证

    1. 认证之APIView 在聊APIView之前, 我们先重温一下django2.x的CBV流程 a. 对于django而言, 当浏览器请求到达之后,按照规则首先会经过各大中间件(Middlewar ...

  7. DFS template and summary

    最近一直在学习Deep Frist Search,也在leetcode上练习了不少题目.从最开始的懵懂,到现在遇到问题基本有了思路.依然清晰的记得今年2月份刚开始刷题的时做subsets的那个吃力劲, ...

  8. 洛谷P2888 [USACO07NOV]牛栏Cow Hurdles

    题目描述 Farmer John wants the cows to prepare for the county jumping competition, so Bessie and the gan ...

  9. 【BZOJ3110】K大数查询(权值线段树套线段树+标记永久化,整体二分)

    题意:有N个位置,M个操作.操作有两种,每次操作 如果是1 a b c的形式表示在第a个位置到第b个位置,每个位置加入一个数c 如果是2 a b c形式,表示询问从第a个位置到第b个位置,第C大的数是 ...

  10. ubuntu14.04 配置网络

    ubuntu14.04 配置网络的练习 本文参考的资料: https://blog.csdn.net/liu782726344/article/details/52912797. 感谢作者的分享! 打 ...