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

Hidden Indexes (NODE-2591) #2548

Merged
merged 4 commits into from
Sep 25, 2020
Merged

Hidden Indexes (NODE-2591) #2548

merged 4 commits into from
Sep 25, 2020

Conversation

reggi
Copy link
Contributor

@reggi reggi commented Sep 21, 2020

NODE-2591

PR to implement the feature "hidden indexes".

Uses a new HideIndexOperation to send the command specified in SPEC-1678's scope. This one operation handles both hiding indexes and unhiding index. I didn't see the point in creating two new operations when it's just a matter of adding a boolean option.

I didn't have access to the collection name within the operation so I added it in from the parent, this is because the ns replaces the collection with $cmd. Would love to know a better way of doing this if there is one.

Adds hidden option to createIndex and test for that as well.

I made an attempt at adding in the 'expireAfterSeconds' option to .hideIndex() but when sent I got this error:

Uncaught AssertionError: expected [MongoError: no expireAfterSeconds field to update] to not exist

So I figured it may not need to be added.

Adds hidden option to IndexOptions.

@reggi reggi requested a review from mbroadst September 21, 2020 21:30
@reggi reggi marked this pull request as ready for review September 21, 2020 21:30
@reggi
Copy link
Contributor Author

reggi commented Sep 21, 2020

@mbroadst Can you give me some guidance to see if I'm on track here?

@mbroadst
Copy link
Member

@reggi where did the requirement to make hideIndex/unhideIndex helpers come from? I'm not seeing that in the spec changes linked to the DRIVERS ticket. In adherence to the driver mantra minimize administrative helpers I would think we would not provide them.

The index management spec is focused on "immutable" interaction with indexes, even though the collMod method exists and allows indexes to be modified in place the goal of this spec change was to support a hidden property for index creation only.

@reggi reggi changed the title NODE-2591/hidden-indexes Hidden Indexes (NODE-2591) Sep 25, 2020
@reggi reggi merged commit ee8ca1a into master Sep 25, 2020
@reggi reggi deleted the NODE-2591/hidden-indexes branch September 25, 2020 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants