Skip to content

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

Merged
merged 7 commits into from
Jun 6, 2023

Conversation

lerouxb
Copy link
Contributor

@lerouxb lerouxb commented May 31, 2023

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.

@lerouxb lerouxb changed the title feat(shell-api): search index management helpers MONGOSH-1455 feat(shell-api): search index management helpers MONGOSH-1455 MONGOSH-1456 Jun 2, 2023
@lerouxb lerouxb marked this pull request as ready for review June 2, 2023 14:17
@lerouxb lerouxb force-pushed the search-index-helpers branch from ad2d2e5 to 588f9a8 Compare June 2, 2023 14:18
@lerouxb lerouxb force-pushed the search-index-helpers branch from 588f9a8 to de6038f Compare June 2, 2023 14:19
@serverVersions(['6.0.0', ServerVersions.latest])
@returnsPromise
@apiVersions([])
async createSearchIndexes(descriptions: any[]): Promise<string[]> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
async createSearchIndexes(descriptions: any[]): Promise<string[]> {
async createSearchIndexes(descriptions: Document[]): Promise<string[]> {

Copy link
Contributor Author

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See de6038f

Copy link
Collaborator

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

@lerouxb lerouxb merged commit 2acbee0 into main Jun 6, 2023
@lerouxb lerouxb deleted the search-index-helpers branch June 6, 2023 11:27
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.

2 participants