码迷,mamicode.com
首页 > 数据库 > 详细

mongodb3.0 db.addUser报错

时间:2015-06-19 10:09:57      阅读:307      评论:0      收藏:0      [点我收藏+]

标签:

> db.addUser("ydkt","ydkt")
2015-06-19T09:22:37.004+0800 E QUERY    TypeError: Property addUser of object admin is not a function
    at (shell):1:4
> 

原来在mongodb3.0中addUser已被废弃,具体参考:

http://docs.mongodb.org/manual/reference/method/db.createUser/#create-administrative-user-with-roles

> db.createUser({user:ydkt,pwd:ydkt,roles:[readWrite,dbAdmin]})
Successfully added user: { "user" : "ydkt", "roles" : [ "readWrite", "dbAdmin" ] }
> 

 

mongodb3.0 db.addUser报错

标签:

原文地址:http://www.cnblogs.com/yshyee/p/4587689.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!