Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-18518

Add filter support for listIndexes

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Index Maintenance
    • Labels:
      None
    • Query Optimization
    • Major Change

      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
      }
      

            Assignee:
            backlog-query-optimization [DO NOT USE] Backlog - Query Optimization
            Reporter:
            scotthernandez Scott Hernandez (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated: