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

原来在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" ] }
>
05-11 07:54