feat(NODE-6044): add detailed types for SearchIndexDescription#4052
feat(NODE-6044): add detailed types for SearchIndexDescription#4052noseworthy wants to merge 1 commit intomongodb:mainfrom
SearchIndexDescription#4052Conversation
|
Hi @noseworthy thanks so much for all your work on this PR. We're currently reviewing this and will get back to you soon. |
|
Hi @noseworthy! Thanks for your patience and thanks again for all your hard work on this PR. After reviewing it with the team, we've decided that accepting these changes into the driver isn't the right choice for us at the moment. Taking on the burden of keeping these types accurate as the Atlas Search product continues to be developed is not something we can commit to at this time. |
No worries, @W-A-James . Thanks for taking a look and considering it. We're really excited to start using the Atlas Search features more now that we can run it locally for our dev environments but I found definitions for the indices really complicated. I was hoping that this would've been able to make it a bit more approachable than a simple Hopefully as the product evolves we can get better typescript support for some of these features 🤞. Thanks for all the team's work on the driver! |
Description
Adds more detailed type definitions for
SearchIndexDescriptionandSearchIndexDefinitionbased on the documentation found at Create an Atlas Search Index.The existing type:
allows users to use any object for the
definitionproperty. 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.Documentis 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:lintscripttype(NODE-xxxx)[!]: descriptionfeat(NODE-1234)!: rewriting everything in coffeescript