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 #291

Open
gkampitakis opened this issue Sep 21, 2021 · 0 comments
Open

Missing index on key property on Mongodb #291

gkampitakis opened this issue Sep 21, 2021 · 0 comments

Comments

@gkampitakis
Copy link

In my company, we are using this library. I am guessing it's no longer maintained but I thought it would be worth creating an issue, in case someone else comes across with the same issue.

This library creates an index for querying the collection

collection.ensureIndex({_bucketname: 1, key: 1}, function(err){

The problem appears when setting the useSingle to false, as we are querying the collections using the {key:<value>}

var updateParams = (self.useSingle? {_bucketname: bucket, key:key} : {key:key});

meaning we are not using the created index resulting to slow queries not taking advantage of the index.

@gkampitakis gkampitakis changed the title Missing index on key property Missing index on key property on Mongodb Sep 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant