Skip to content

GODRIVER-2221 add unique, expires, and sparse to index options #794

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

Merged
merged 1 commit into from
Nov 9, 2021

Conversation

kwasnick
Copy link
Contributor

@kwasnick kwasnick commented Nov 5, 2021

What

Adding Unique, ExpireAfterSeconds, and Sparse to the IndexSpecification type returned from collection.ListSpecifications().

Why

I've been working on some tooling that relies on fetching the current state of the indexes in a collection. It seems like just a pure oversight to not include these values in the returned IndexSpecification object, seeing as they are available just fine from mongosh and the like.

How

Just added the fields so that they will be appropriately unmarshalled from the bson response, and amended the existing "list specifications" unit test to verify that they are working.

Copy link
Collaborator

@matthewdale matthewdale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @kwasnick! Looks good 👍

@kevinAlbs kevinAlbs changed the title add unique, expires, and sparse to index options GODRIVER-2221 add unique, expires, and sparse to index options Nov 9, 2021
Copy link
Contributor

@kevinAlbs kevinAlbs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the contribution @kwasnick! LGTM

@kevinAlbs kevinAlbs merged commit 2806752 into mongodb:master Nov 9, 2021
@kwasnick
Copy link
Contributor Author

@kevinAlbs @matthewdale thanks! What's the standard policy / timeline on releasing new versions?

@matthewdale
Copy link
Collaborator

@kwasnick This will be released with the next minor version (v1.8.0), which is tentatively scheduled to be released on Nov 16.

gabbyasuncion pushed a commit to gabbyasuncion/mongo-go-driver that referenced this pull request Nov 18, 2021
faem pushed a commit to kubedb/mongo-go-driver that referenced this pull request Mar 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants