我在 mongodb 中有一个文档结构如下
{
"_id": "some_id",
"key1": "value1",
"key2": "value2",
"key3": [
{"subkey1":"subval1", "subkey2":"subval2", "subkey3":"subval3"},
{"subkey1":"subval11", "subkey2":"subval21", "subkey3":"subval31"},
{"subkey1":"subval12", "subkey2": "subval22", "subkey3":"subval32"}
],
"key4": "value4"
}
我想把索引放在“subkey1”上。怎么做???
还是不可能(在这种情况下,它是否可以有效地使用“key3”上的索引)???