Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GODRIVER-2701 Implement a variant of DropIndex that gets keys rather than name #1683

Open
wants to merge 16 commits into
base: v1
Choose a base branch
from

Conversation

timothy-kim-mongo
Copy link
Collaborator

GODRIVER-2701

Summary

The changes in this pull-request answers the ticket GODRIVER-2701of implements a variant of DropIndex that searches for the index using the key rather than the name of the index. This creates an additional method that allows users to drop index with the freedom of either a name or key.

Background & Motivation

The motivation behind this is to be consistent with the functionality of the MongoDB db.collection.dropIndex() function which allows dropping the index with either a key or name. This is an optional part of the spec - https://github.com/mongodb/specifications/blob/master/source/index-management/index-management.md#standard-api.

@timothy-kim-mongo timothy-kim-mongo self-assigned this Jun 20, 2024
@timothy-kim-mongo
Copy link
Collaborator Author

Note: 56850c7 and before have an implementation of DropOne method taking in a generic of either the key or name which could be considered for 2.0.

@mongodb-drivers-pr-bot mongodb-drivers-pr-bot bot added the priority-3-low Low Priority PR for Review label Jun 20, 2024
Copy link

mongodb-drivers-pr-bot bot commented Jun 20, 2024

API Change Report

./mongo

compatible changes

IndexView.DropWithKey: added

./x/mongo/driver/operation

incompatible changes

(*DropIndexes).Index: changed from func(string) *DropIndexes to func(any) *DropIndexes
NewDropIndexes: changed from func(string) *DropIndexes to func(any) *DropIndexes

@qingyang-hu qingyang-hu requested review from prestonvasquez and removed request for blink1073 June 21, 2024 13:27
mongo/index_view.go Outdated Show resolved Hide resolved
mongo/index_view.go Outdated Show resolved Hide resolved
mongo/index_view.go Outdated Show resolved Hide resolved
mongo/index_view.go Outdated Show resolved Hide resolved
mongo/integration/main.go Outdated Show resolved Hide resolved
mongo/integration/index_view_test.go Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority-3-low Low Priority PR for Review
Projects
None yet
2 participants