Add user error on MongoDB as follows:
> Db.adduser (' User01 ', ' 123456 '); 2016-07-29t14:50:28.932+0800 E QUERY typeerror:property ' addUser ' of object Admin I s not a-function at (shell): 1:4
After the investigation, the reason is that in MongoDB version 3 has been deprecated adduser, changed to CreateUser.
[[email protected] bin]$ ./mongo 127.0.0.1:27017mongodb shell version: 3.0.6connecting to: 127.0.0.1:27017/test> use adminuse adminswitched to Db admin> db.version () 3.0.6> db.createuser ({User: ' User01 ', pwd: ' 123456 ', roles: [' Useradminanydatabase ']}) successfully added user: { "User" : "User01", "Roles" : [ " Useradminanydatabase " ] }> db.auth (" User01 "," 123456 ") 1> show users{ "_id" : "Admin.root", "User" : "root", "db" : "admin", "Roles" : [ { "Role"  : "Useradminanydatabase", "DB" : "admin" } ]}{ "_id" : "Admin.user01", "User" : "User01", "DB" : "admin", "Roles" : [ { "Role" : "Useradminanydatabase", "DB" : "admin" } ]}> exitbye
References: MongoDB Common Operations Command Daquan
This article from "candon123" blog, declined reprint!
MongoDB 3 Add Users