-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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(dal): add deleted index and type safety index #5309
feat(dal): add deleted index and type safety index #5309
Conversation
function index(fields: IndexDefinition<SubscriberEntity>, options?: IndexOptions) { | ||
subscriberSchema.index(fields, options); |
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.
@rifont How about such an approach? while developing I noticed we don't have our indexes typed, meaning we can do indexed typos.
Doing this as a POC, I tried to make it a bit more generic but TS gave me problems :/
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.
mongoose
is so poor when it comes to the types... yes the problems might be because we force some fields...
I like this approach 🙌
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 like it too, let's revisit generic typings as part of a holistic approach to strongly typing Mongoose. Ship it 🚀
function index(fields: IndexDefinition<SubscriberEntity>, options?: IndexOptions) { | ||
subscriberSchema.index(fields, options); |
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.
mongoose
is so poor when it comes to the types... yes the problems might be because we force some fields...
I like this approach 🙌
d504201
into
nv-3567-subscribers-are-duplicated-during-the-burst-of-events
What change does this PR introduce?
We want to optimize the call checking for non deleted subscribers.
This change is recommended by Mongodb Atlas.
As an alternative, the query may need to be changed.
Why was this change needed?
This will increase the query speed of calls looking for non deleted subscribers and will increase the trigger speed.
Other information (Screenshots)