-
-
Notifications
You must be signed in to change notification settings - Fork 135
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
feat: add support for declaring search indexes #921
Conversation
@hasezoey : Sorry, the typings sort of got out of hand here. I can totally remove all that if you'd like. I know it's probably not Anyway, It's pretty easy to simplify if you'd like. I can try and open a PR into the mongo driver repo and see if they'll take them on haha. Also, wasn't sure how to handle the requirement on Finally, thanks so much for your work on |
84c09d8
to
a5d3a1f
Compare
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.
Thanks for the work, there are some small things i have noticed and put some comments up, aside from that there is also:
- the new documentation page has not been added to the sidebars yet
- i would prefer if those extra types could be upstreamed to mongoose (or even mongodb?)
- some places have been missed for the changed mongoose version
i will put up a update on the beta branch, please target that as a base
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## beta #921 +/- ##
==========================================
+ Coverage 98.65% 98.67% +0.02%
==========================================
Files 17 18 +1
Lines 967 984 +17
Branches 261 252 -9
==========================================
+ Hits 954 971 +17
Misses 13 13 ☔ View full report in Codecov by Sentry. |
i will not be able to upgrade mongoose until Automattic/mongoose#14463 is merged and released (the same cause on why the test CI failed here) |
a5d3a1f
to
95056d1
Compare
Thanks for the review @hasezoey ! I think I've addressed all the comments. I see that the I've created NODE-6044 in the I've opened another PR in Thanks again for your patience with this and your review. I apologize in advance if there's any more dumb issues or if I've missed something. Still getting my feet under me in this repo 😅! |
from what i can see, yes
i dont want to push broken test commits, so i have not pushed the mongoose 8.2.3 update there and wait until Automattic/mongoose#14463 is resolved. |
slight update, Automattic/mongoose#14463 has been merged, now just waiting until 8.2.4 is released |
the mongoose version 8.2.4 has been released and the beta branch has been updated (and also released as v12.3.0-beta.1), please rebase onto that PS: also dont forgot the set the PR base branch to |
95056d1
to
2829dda
Compare
MongoDB and `mongoose` now support adding search indexes to collections. Introduce a new decorator `@searchIndex()` that, similar to `@index`, adds a search index to a collection. Search index support was added to `mongoose` in version `8.1.0`, however the type definition for `Schema.searchIndex()` didn't exist until `8.2.3`, and `mongoose` didn't export the search index definition type until `8.2.4`. Therefore this change requires `mongoose` `8.2.4`.
2829dda
to
eb324f3
Compare
All done, @hasezoey! Thanks again for helping review this change. If there's anything else you'd like done, just let me know. |
🎉 This PR is included in version 12.3.0-beta.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 12.3.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
The search index decorator (`@searchIndex()`) was added in `v12.3.0` in PR typegoose#921 but I neglected to actually export the decorator so it isn't currently available for use.
The search index decorator (`@searchIndex()`) was added in `v12.3.0` in PR typegoose#921 but I neglected to actually export the decorator so it isn't currently available for use.
The search index decorator (`@searchIndex()`) was added in `v12.3.0` in PR #921 but I neglected to actually export the decorator so it isn't currently available for use.
MongoDB and
mongoose
now support adding search indexes to collections. Introduce a new decorator@searchIndex()
that, similar to@index
, adds a search index to a collection.Search index support was added to
mongoose
in version8.1.0
, however the type definition forSchema.searchIndex()
didn't exist until8.2.3
. Therefore in order to support this feature, update themongoose
dependencies to~8.2.3
.Related Issues