feat(NODE-6044): add detailed types for SearchIndexDescription
#4052
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Adds more detailed type definitions for
SearchIndexDescription
andSearchIndexDefinition
based on the documentation found at Create an Atlas Search Index.The existing type:
allows users to use any object for the
definition
property. Search index definitions are fairly complicated and having more strict types defined for this property will make it easier to use thecreateSearchIndex()
andupdateSearchIndex()
apis.What is changing?
Added full types for defining a search index definition.
Is there new documentation needed for these changes?
I don't think any new hand-written documentation is necessary, but new tsdoc documentation should be generated to capture the new types.
What is the motivation for this change?
Using the
createSearchIndex()
andupdateSearchIndex()
apis when the definition is just specified to be abson.Document
is a bit unwieldy. The search index definitions can be fairly complicated, and it's very helpful to have TypeScript help validate the definitions.Release Highlight
Fill in title or leave empty for no highlight
Double check the following
npm run check:lint
scripttype(NODE-xxxx)[!]: description
feat(NODE-1234)!: rewriting everything in coffeescript