bramski / angular-indexedDB

An angularjs serviceprovider to utilize indexedDB with angular
165 stars 49 forks source link

getAll with limits #84

Open SmetLeander opened 6 years ago

SmetLeander commented 6 years ago

Hello,

I have an issue here where I need to get the last 2000 records from an indexeddb store. Since it's used for logging, the value on a record can be big. What's the best solution to do this. I tried putting an index on the primary key, and use a query with a between on the index, but it's really slow. Would it be possible to use a limit on the getall?

Thanks in advance!

bramski commented 6 years ago

Can you clarify what's slow? The between query is just proxying to the indexed db api so I've a hard time understanding what would be slow there.

bramski commented 6 years ago

Alternatively there is an old pull request: https://github.com/bramski/angular-indexedDB/pull/63

I had asked the author for changes but he never made any fixes. You are more than welcome to complete his work.