-
Notifications
You must be signed in to change notification settings - Fork 18
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
Any easy way to create multi-field indexes, not just single field? #24
Comments
Treo supports var treo = require('treo');
var schema = treo.schema()
.version(1)
.addStore('magazines', { key: 'id' })
.addIndex('byWords', 'words', { multi: true }); Is it what you need? |
I do not think so. I'm under the (possibly wrong) impression that indexeddb allows indexes based on multiple field values, not just a named array field. |
Ah, probably you mean something like: http://stackoverflow.com/a/16503172 schema.addIndex('compoundIndex', ['field1', 'field2']); Currently treo does not allow to do this, because it expects string as a key field: https://github.com/alekseykulikov/treo/blob/master/lib/schema.js#L90 I will mark it as a feature for next release. |
Another thing to add to the feature list might be an easy way to call |
Yes, support of ranges in |
We've just run into this issue. Is there a way to drop down to raw indexeddb to add the index with multiple fields until it's been added to treo? 😕 |
treo@0.5.0 adds support for this functionality. |
Thanks for the quick response. Much appreciated! |
Indeed! Didn't expect this to land so soon. Thanks for your work! 👍 |
You're welcome, guys! |
No description provided.
The text was updated successfully, but these errors were encountered: