[JAVA-2757] MongoCollection.dropIndex(Bson keys) does not work for non-generated index names Created: 29/Jan/18  Updated: 28/Oct/23  Resolved: 22/May/18

Status: Closed
Project: Java Driver
Component/s: Command Operations
Affects Version/s: 3.6.1
Fix Version/s: 3.8.0

Type: Bug Priority: Minor - P4
Reporter: Daniel Fesenmeyer [X] Assignee: Jeffrey Yemin
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to DOCS-11271 Index field in dropIndex command can ... Closed

 Description   

This is because DropIndexOperation#(MongoNamespace namespace, BsonDocument keys, WriteConcern writeConcern) generates an index name and calls the server with this generating index name instead of passing the keys to the server.



 Comments   
Comment by Githook User [ 22/May/18 ]

Author:

{'username': 'jyemin', 'name': 'Jeff Yemin', 'email': 'jeff.yemin@10gen.com'}

Message: JAVA-2757: Drop index by keys when keys are provided

When the application drops an index using a method that takes the index
keys, rather than the name, the driver drops the index by those keys
rather than constructing a name from the keys and dropping it by that
name.

This allows the dropping of index by keys even when the index was
created with a name other than the default name.
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/a9cfe5f666953d192e82391c64f9f33408c9e0c5

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