Skip to content
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

Missing index on key property on Mongodb #4

Closed
gkampitakis opened this issue Sep 21, 2021 · 3 comments
Closed

Missing index on key property on Mongodb #4

gkampitakis opened this issue Sep 21, 2021 · 3 comments

Comments

@gkampitakis
Copy link

I created an issue to the original repository just in case someone has the same issue. What was noticed is that the library creates an index

collection.createIndex({ _bucketname: 1, key: 1 }, (err) => {
and then in the case of the useSingle=false we are not using this index as we are querying with just the key meaning we are not using the index resulting to slow queries. Maybe the index could respect the useSingle flag and create the correct index.

var updateParams = this.useSingle ? { _bucketname: bucket, key: key } : { key: key };

@koresar
Copy link

koresar commented Sep 22, 2021

Sound like a good idea.
Would you please a PR? We love PRs!

@gkampitakis
Copy link
Author

I am happy to 😄 , I will try to work on it today and send a pr

@koresar
Copy link

koresar commented Oct 25, 2021

Thanks! Sorry for the delay. PR reviewed, merged, published as v2.0.1

@koresar koresar closed this as completed Oct 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants