随笔分类 - mongoDB
摘要:admin = db.getSiblingDB("admin") admin.createUser( { user: "fred", pwd: "changeme1", roles: [ { role: "userAdminAnyDatabase", db: "admin" } ] } ) mong
阅读全文
摘要:2018-07-17T08:02:42.941+0000 I NETWORK [initandlisten] Listener: accept() returns -1 errno:24 Too many open files2018-07-17T08:02:42.941+0000 E NETWOR
阅读全文
摘要:1.mongoexport 与mongoimport export mongoexport --host "localhost:27017" --username="user" --password="xxxx" --authenticationDatabase=testdb --db=testdb
阅读全文
摘要:移除复制集成员 操作步骤 1.shell登录待移除成员实例,执行db.shutdownserver() 2.连接到primary,用db.ismaster()确定primary 3.rs.remove()移除成员-->rs.remove("mongod3.example.net:27017") 备注
阅读全文
摘要:当mongo collection的名字当中存在特殊字符时,在shell中对改集合进行操作会报SyntaxError: identifier starts immediately after numeric literal的错误。 解决办法:getCollection函数将collection na
阅读全文