【发布时间】:2021-12-29 02:08:07
【问题描述】:
我的 mongo 文档中有一个字段“productLowerCase”。我创建了 2 个索引
1. simple
{"productLowerCase" : 1}
2. compound
{"productLowerCase" : 1, "timestamp.milliseconds" : -1}
所以如果我运行一个只有 productLowerCase 的查询,说:
db.coll.find({"productLowerCase" : {$regex : /^cap/}})
将使用哪个索引?
【问题讨论】:
标签: mongodb mongoose indexing mongodb-query mongodb-indexes