webcss / angular-indexedDB

An angularjs serviceprovider to utilize indexedDB with angular
149 stars 99 forks source link

There is no documentation about the usage of QueryBuilder. #2

Open thvd opened 11 years ago

webcss commented 11 years ago

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)

marlonpp commented 10 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.

webcss commented 10 years ago

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.