摘要:
1.查询 使用db.collection.find()方法进行查询。db.collection.findOne()返回单个文档。mongodb的所有查询操作都是针对单个collection > db.users.find({age:{$gt:18}}).sort({age:1}) 2.修改(创建、更 阅读全文
阅读排行榜
MongoDB Database Profiler
2024-03-18 10:45 by abce, 205 阅读, 收藏,
摘要:
本文对应的版本是7.0。 MongoDB 的 Profiler 会将收集到的所有数据写入 system.profile 集合, system.profile 集合是一个 capped 集合,每个开启 profiler 的数据库都会有一个system.profile 集合。 Profiler 默认是关 阅读全文
SHOW REPLICA STATUS 结果简化分析
2023-11-02 10:32 by abce, 205 阅读, 收藏,
摘要:
root@localhost (none)>show replica status\G *************************** 1. row *************************** Replica_IO_State: Waiting for source to sen 阅读全文
LIKE比较查询优化
2023-06-15 15:04 by abce, 205 阅读, 收藏,
摘要:
在执行检索时,有两种方式可以使用到索引:1.单值查询,比如where id=22.范围查询,比如where id between 2 and 20、where id<20 当使用like来检索文本的开始位置,实际上是一种范围查找。事实上,下面的两个查询是等价的: SELECT ... FROM .. 阅读全文
Python Decorator 和函数式编程
2016-11-16 13:38 by abce, 204 阅读, 收藏,
摘要:
看到一篇翻译不错的文章,原文链接: Python Decorator 和函数式编程 阅读全文