一、常用索引类型
1、单个索引
db.你的表名.createIndex({"你的字段名":1}) 
 
db.你的表名.createIndex({"你的字段名":1}),{ unique: true }) 
2、复合索引
db.你的表名.createIndex({"你的字段名1":1,"你的字段名2":1}) 
二、性能分析
db.getCollection('你的表名').find({'你的字段名':"过滤的内容"}).explain("executionStats"); 
 
ARM32开发--串口库封装(初级)
阅读 11
2024-06-12
db.你的表名.createIndex({"你的字段名":1}) 
 
db.你的表名.createIndex({"你的字段名":1}),{ unique: true }) 
db.你的表名.createIndex({"你的字段名1":1,"你的字段名2":1}) 
db.getCollection('你的表名').find({'你的字段名':"过滤的内容"}).explain("executionStats"); 
 
相关推荐
精彩评论(0)