Details
-
Improvement
-
Resolution: Unresolved
-
Minor - P4
-
None
-
None
-
None
-
Query Optimization
-
Major Change
Description
With support for a server applied filter you will be able to get just indexes you care about.
> db.a.runCommand("listIndexes") |
{
|
"cursor" : { |
"id" : NumberLong(0), |
"ns" : "test.$cmd.listIndexes.a", |
"firstBatch" : [ |
{
|
"v" : 1, |
"key" : { |
"_id" : 1 |
},
|
"name" : "_id_", |
"ns" : "test.a" |
},
|
{
|
"v" : 1, |
"key" : { |
"a" : 1 |
},
|
"name" : "a_1", |
"ns" : "test.a" |
},
|
{
|
"v" : 1, |
"key" : { |
"b" : 1 |
},
|
"name" : "b_1", |
"ns" : "test.a" |
}
|
]
|
},
|
"ok" : 1 |
}
|
> db.a.runCommand("listIndexes", {filter:{"key.a":{$exists:1}}}) |
{
|
"cursor" : { |
"id" : NumberLong(0), |
"ns" : "test.$cmd.listIndexes.a", |
"firstBatch" : [ |
{
|
"v" : 1, |
"key" : { |
"a" : 1 |
},
|
"name" : "a_1", |
"ns" : "test.a" |
}
|
]
|
},
|
"ok" : 1 |
}
|
Attachments
Issue Links
- is depended on by
-
DRIVERS-244 get index by name
-
- Closed
-
- is duplicated by
-
SERVER-21888 Provide operation to determine if an index exists
-
- Closed
-