Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-11271

Index field in dropIndex command can be a document containing the keys in the index

    • Type: Icon: Task Task
    • Resolution: Won't Do
    • Priority: Icon: Major - P3 Major - P3
    • Server_Docs_20231030
    • Affects Version/s: None
    • Component/s: Server
    • Labels:
      None

      This works back to 2.6:

      MongoDB Enterprise > db.runCommand({createIndexes : "java2757", indexes : [{key : {score : 1}, name : "myScoreIdx" }] })
      {
      	"createdCollectionAutomatically" : true,
      	"numIndexesBefore" : 1,
      	"numIndexesAfter" : 2,
      	"ok" : 1
      }
      MongoDB Enterprise > db.runCommand({dropIndexes: "java2757", index : {score : 1}} )
      { "nIndexesWas" : 2, "ok" : 1 }
      

      It's not clear from the documentation that index can be anything other than the index name or "*".

            Assignee:
            Unassigned Unassigned
            Reporter:
            jeff.yemin@mongodb.com Jeffrey Yemin
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              1 year, 26 weeks, 4 days ago