摘要:
pymongo 库 无安全认证连接:client = MongoClient('mongodb://localhost:27017')有安全认证连接:client = MongoClient('mongodb://用户名:密码@localhost:27017/数据库名称') 获得数据库 db = c 阅读全文
posted @ 2018-06-09 11:37
cccy0
阅读(127)
评论(0)
推荐(0)
摘要:
聚合(aggregate): db.集合.aggregate([{管道:{表达式}}]) db.集合.aggregate([ {管道1:{表达式1}}, {管道2:{表达式2}}, ... ...]) 管道1的结果作为管道2的输入. $group:分组 {$group:{ _id:'$gender' 阅读全文
posted @ 2018-06-09 11:36
cccy0
阅读(194)
评论(0)
推荐(0)
摘要:
三元素:数据库 集合 文档(json的扩展bson) 服务启动重启停止: sudo service mongodb start(stop,restart) 修改配置文件 /etc/mongodb.conf添加 smallfiles=true 查看当前数据库 db 查看所有数据库 show dbs 查 阅读全文
posted @ 2018-06-09 11:33
cccy0
阅读(169)
评论(0)
推荐(0)

浙公网安备 33010602011771号