我们正在使用MongoDB进行存储。 我们有一个像下面这样的集合。
collection{
{
"_id" : ObjectId("....."),
"dataCriacao" : ISODate("..."),
"ativo" : true,
"title" : "tile",
"text" : "text",
"badge" : 0,
"pedidoId" : null,
"userID" : null,
"createdByAdmin" : true
}
{
"_id" : ObjectId("..."),
"dataCriacao" : ISODate("..."),
"ativo" : true,
"title" : null,
"text" : null,
"badge" : 0,
"pedidoId" : "2",
"userID" : "6098821",
"createdByAdmin" : false
}}
该集合预计会变得非常大,我会经常根据createdByAdmin查询它。在这种情况下,在此字段上添加索引是否值得?我的老板告诉我,但我在网上发现的一切都是针对布尔字段的索引。