随笔- 807  文章- 150  评论- 23  阅读- 151万 

随笔分类 -  NoSQL MongoDB Shell

MongoDB db.stats()&&db.db.serverStatus()
摘要:db.stats() 示例图 参数解释: "db" : "test" ,表示当前是针对"test"这个数据库的描述。想要查看其他数据库,可以先运行$ use databasename(e.g $use admiin). "collections" : 3,表示当前数据库有多少个collections 阅读全文
posted @ 2019-12-15 16:06 xibuhaohao 阅读(744) 评论(0) 推荐(0) 编辑
MongoDB shell 5 游标方法
摘要:方法名描述 cursor.snapshot() cursor.itcount() cursor.batchSize() cursor.pretty() cursor.hint() cursor.min() cursor.sort() cursor.forEach() cursor.limit() c 阅读全文
posted @ 2019-12-15 15:42 xibuhaohao 阅读(299) 评论(0) 推荐(0) 编辑
MongoDB shell 4 用户管理方法
摘要:方法名描述 db.getUsers() db.dropAllUsers() db.updateUser() db.createUser() db.revokeRolesFromUser() db.removeUser() 删除用户 db.grantRolesToUser() db.getUser() 阅读全文
posted @ 2019-12-15 15:39 xibuhaohao 阅读(205) 评论(0) 推荐(0) 编辑
MongoDB shell 3 集合方法
摘要:方法名描述 db.collection.aggregate() 聚合,主要用于处理数据(诸如统计平均值,求和等),并返回计算后的数据结果 db.collection.bulkWrite() 批量写入 db.collection.createIndex() 创建一个集合索引 db.collection 阅读全文
posted @ 2019-12-15 15:34 xibuhaohao 阅读(246) 评论(0) 推荐(0) 编辑
MongoDB shell 2 副本集方法
摘要:rs.initiate() rs.addArb() rs.help() rs.printReplicationInfo() 查看到副本集操作日志 rs.remove() 减少副本集节点 rs.freeze() “冻结”mongodb实例 rs.status() 查看副本集状态 db.printSla 阅读全文
posted @ 2019-12-15 15:22 xibuhaohao 阅读(285) 评论(0) 推荐(0) 编辑
MongoDB shell 1 数据库方法
摘要:方法名描述 db.cloneDatabase() 从指定主机上克隆数据库 db.currentOp() 显示当前正在进行的操作 db.commandHelp() 返回数据库命令的帮助信息 db.createCollection() 创建一个聚集集合(table) db.cloneCollection 阅读全文
posted @ 2019-12-15 15:20 xibuhaohao 阅读(184) 评论(0) 推荐(0) 编辑
MongoDB Shell db.runCommand
摘要:db.runCommand()示例 我们使用MongoDB Shell登录到mongos,添加Shard节点 [root@100 shard]# /usr/local/mongoDB/bin/mongo admin --port 40000 MongoDB shell version: 2.0.7 阅读全文
posted @ 2019-12-15 11:58 xibuhaohao 阅读(2399) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示