[DOCS-11271] Index field in dropIndex command can be a document containing the keys in the index Created: 30/Jan/18  Updated: 30/Oct/23

Status: Closed
Project: Documentation
Component/s: Server
Affects Version/s: None
Fix Version/s: Server_Docs_20231030

Type: Improvement Priority: Major - P3
Reporter: Jeffrey Yemin Assignee: Unassigned
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to JAVA-2757 MongoCollection.dropIndex(Bson keys) ... Closed
Participants:
Days since reply: 1 year, 14 weeks, 2 days ago
Epic Link: DOCSP-1769
Story Points: 0.25

 Description   

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 "*".



 Comments   
Comment by Education Bot [ 31/Oct/22 ]

Hello! This ticket has been closed due to inactivity. If you believe this ticket is still important, please reopen it and leave a comment to explain why. Thank you!

Comment by Jeffrey Yemin [ 30/Jan/18 ]

See Eric Milkie's comment on JAVA-2757 for a good specification of the behavior, where he also points out the "*" is now disallowed (though still works as of 3.6, so maybe this is a change for the 4.0 docs)

Generated at Thu Feb 08 08:02:27 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.