Closed mhsimkin closed 9 years ago
This is really difficult to read, can you please use github markup properly?
So the query interface really isn't very complex. You can't query on multiple indexes. Only the last call to $index is going to be effective. Read the source code, it's pretty stupid simple. Same thing with all of the $lt, $gt, and $lte functions, you're basically overwriting the other query parameters. IndexedDB only supports a basic range check in the iterator.
It's just a thin wrapper around the IDBKeyRange interface: https://developer.mozilla.org/en-US/docs/Web/API/IDBKeyRange
So your querying ability is limited by that; and angular-indexed-db essentially implements that. Any further filtering on "secondary indices" you'll have to implement on your own after the fact or build a compound index on which you can execute your query.
In chrome it seems that the main index is just called "key", and by default a query executes against this. May vary per browser? I can't find any standards on it's name. If you specify no index for your query you should execute against the primary key.
I haven't used compound indices at all though, so if you get that working do post an example about how it works! I'm guessing you just specify a tuple to run the query? Best of luck.
Thank you for all the help. If I figure out how to use compound keys, I will let you know.
Figure this out? I'm closing this issue.
I'm trying to figure out how I can filter my data against multiple columns.
The schema for the object being stored in indexeddb is:
I have set up and configured my object store as:
I am trying to filter this way:
I should not be getting any values back, as the "Environment" column in the doesn't contain any values for "REN-Prod".
Also, how do I just query against the primary key?
thank you for your help.
marc