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

Object queries (where({...})) cannot reuse virtual indexes if two or more props are specified #1740

Closed
dfahlander opened this issue Jun 12, 2023 · 0 comments

Comments

@dfahlander
Copy link
Collaborator

dfahlander commented Jun 12, 2023

A object query such as:

await db.chaps.where({name: "Mambo", number: 5}).toArray();

returns empty array if there's a compound index covering 3 props with these 2 as the leading ones.

Schema has a compound index [name+number+shoeSize] that should be able to reuse parts of but the bug is that the queries only works if the object query either contains a single property (name) or all properties (name, number, shoeSize) but not when containing partials.

db.version(x).stores({
    chaps: "++id,[name+number+shoeSize]",
});

Also, instead of failing, it returns empty result.

dfahlander added a commit that referenced this issue Jun 12, 2023
...still return empty result instead of failing if the no index could be found to resolve the query.
dfahlander added a commit that referenced this issue Jun 12, 2023
dfahlander added a commit that referenced this issue Jun 12, 2023
...still return empty result instead of failing if the no index could be found to resolve the query.
dfahlander added a commit that referenced this issue Jun 12, 2023
dfahlander added a commit that referenced this issue Jun 12, 2023
...still return empty result instead of failing if the no index could be found to resolve the query.
dfahlander added a commit that referenced this issue Jun 12, 2023
dfahlander added a commit that referenced this issue Jun 12, 2023
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