http://blog.chinaunix.net/uid-28595538-id-4987410.html
1.js
db=db.getSiblingDB("admin");
db.auth("root","111111");
db.changeUserPassword("root","123456");
print("password updated successfully!");
2.js
db=db.getSiblingDB("admin");
db.auth("root","111111");
var strInfo;
strInfo=db.getCollectionNames();
print(tojson(strInfo));
db.system.users.find();
strInfo=db.runCommand({usersInfo:"root"});
print(tojson(strInfo));
strInfo=db.getUser("root");
print(tojson(strInfo));