Insting saya tidak, jadi saya coba saja:
> db.foo.find()
> db.foo.getIndexes()
[
{
"v" : 1,
"key" : {
"_id" : 1
},
"name" : "_id_",
"ns" : "foo.foo"
}
]
> db.foo.insert({
... _id: "joe",
... name: "Joe Bookreader",
... addresses: [
... {
... _id: "someid1",
... street: "123 Fake Street",
... city: "Faketon",
... state: "MA",
... zip: "12345"
... },
... {
... _id: "someid2",
... street: "1 Some Other Street",
... city: "Boston",
... state: "MA",
... zip: "12345"
... }
... ]
... })
WriteResult({ "nInserted" : 1 })
> db.foo.getIndexes()
[
{
"v" : 1,
"key" : {
"_id" : 1
},
"name" : "_id_",
"ns" : "foo.foo"
}
]
>
Sepertinya tidak, itu tidak secara otomatis membuat indeks pada subdokumen.