每个集合默认的最大索引个数为64个。
如果没有对应的键,索引会将其作为null存储,所以,如果对某个建立了唯一索引,但插入了多个缺少该索引键的文档,则由于文档包含null值而导致插入失败。 ...例子
> db.users.find()
{ "_id" : ObjectId("4fc6d0c9387a7fee4eb6bfa9"), "name" : "aaa", "age" : 23, "sex..." }
{ "_id" : ObjectId("4fc6d0f4387a7fee4eb6bfab"), "name" : "ccc", "age" : 25, "sex" : "male" }
{...1,//返回文档的数量
"millis" : 50,//数据库执行查询时间
"nYields" : 0,
"nChunkSkips" : 0,
... 23
]
]
}
}
3. hint强制使用某个索引