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

listCollections output should include _id index spec as idIndex

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Blocker - P1
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.4.0-rc1
    • Component/s: Querying
    • Labels:
      None

      Description

      > db.runCommand({listCollections: 1})
      {
      	"cursor" : {
      		"id" : NumberLong(0),
      		"ns" : "test.$cmd.listCollections",
      		"firstBatch" : [
      			{
      				"name" : "c",
      				"type" : "collection",
      				"options" : {
      					
      				},
      				"info" : {
      					"readOnly" : false
      				}
      				“idIndex”: {
      					"v" : 1,
      					"key" : {
      						"_id" : 1
      						},
      					"name" : "_id_",
      					"ns" : "test.c"
      				}
      			},
      ]	
      }
      }
      

      The idIndex field will not be included for views or collections without an _id index.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              tess.avitabile Tess Avitabile
              Reporter:
              tess.avitabile Tess Avitabile
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: