I think explain()
will tell any possible index it can use. How about just showing all the indexes defined on the collection? (or even for the whole db?)
views:
10answers:
1
+2
A:
>db.system.indexes.find();
>db.system.indexes.find( { ns: "tablename" } );
will give you something like
{
"ns" : "test.fs.chunks",
"key" : { "files_id" : 1, "n" : 1 },
"name" : "files_id_1_n_1"
}
for every index (ns
is the collection name).
Thilo
2010-09-21 05:54:42
looks like the `ns:` portion needs a database name and collection name, such as `foo.analytics`
動靜能量
2010-09-22 03:08:20