[c++,bson] linux 使用 BSON 编程[www]

[c++,bson] linux 使用 BSON 编程            

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));

 

posted on 2017-07-29 17:32  chulia  阅读(247)  评论(0编辑  收藏  举报

导航