Open thvd opened 11 years ago
Can I use more than one index to construct a query? var myQuery = $indexedDB.queryBuilder.$index('age_idx').$gt(40).$asc.$index('name_idx').$eq("test").compile;
Something like that.
No, you can only use one index per query, this is a limitation of indexedDB. As a workaround you can use your first index to limit a query, then open a cursor and test for secondary values to narrow your resultset.
QueryBuilder is intended to create an IDBKeyRange object. Simply call e.g. var keyrange = queryBuilder.$gt(20).compile; and use it in e.g. indexedDB.each(keyrange)