在NoSQL中索引布尔值?

时间:2014-03-21 18:11:04

标签: mongodb indexing database nosql

我们正在使用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查询它。在这种情况下,在此字段上添加索引是否值得?我的老板告诉我,但我在网上发现的一切都是针对布尔字段的索引。

0 个答案:

没有答案