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

FindIn plugin example fails when at least 2 keys being looked for are smaller than the smallest key in the db #40

Open
randalpinto opened this issue Nov 19, 2015 · 1 comment

Comments

@randalpinto
Copy link

If you have let's say "2013", "2014", "2015" in the database and if you search for ["2011", "2012"] the plugin fails as it goes into:

if (cursor.key > keys[current]) {
result.push(undefined); // key not found
current += 1;
cursor.continue(keys[current]);
}

and then it tries to execute:

cursor.continue("2012") but the current cursor position is "2013" so the operation returns an error.

Granted it is just an example but it was a useful operation for me and I found the issue while trying to use it. I'd vote for it to become an official plugin as large lookups are a lot faster performed like this.

@alekseykulikov
Copy link
Contributor

Thank you for bug report.
I will probably implement it as a standalone plugin, since it's indeed quite useful.

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

2 participants