-
Notifications
You must be signed in to change notification settings - Fork 76
feat(shell-api): search index management helpers MONGOSH-1455 MONGOSH-1456 #1477
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
Conversation
ad2d2e5
to
588f9a8
Compare
588f9a8
to
de6038f
Compare
@serverVersions(['6.0.0', ServerVersions.latest]) | ||
@returnsPromise | ||
@apiVersions([]) | ||
async createSearchIndexes(descriptions: any[]): Promise<string[]> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
async createSearchIndexes(descriptions: any[]): Promise<string[]> { | |
async createSearchIndexes(descriptions: Document[]): Promise<string[]> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had it as Document, but then deliberately changed it to any because it felt like that's more likely to stand out as something we have to type properly once we can.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See de6038f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We’re using Document
quite extensively here in the shell-api package, and that’s probably a good thing, because these methods are user-facing and it’s not like we could tell the user to really always give us input that exactly matches the driver types
I added getSearchIndexes() which, like getIndexes() returns an array. I made the service provider method listSearchIndexes which returns the cursor. So we could add easily add listSearchIndexes() later that returns the cursor if we want to. ie. by convention get could return an array and list could return a cursor. We'd probably want to do the same for normal indexes if we go that route, though.