angular-indexedDB icon indicating copy to clipboard operation
angular-indexedDB copied to clipboard

getAll with limits

Open SmetLeander opened this issue 7 years ago • 2 comments

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!

SmetLeander avatar Mar 26 '18 07:03 SmetLeander

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 avatar Mar 26 '18 15:03 bramski

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.

bramski avatar Mar 26 '18 15:03 bramski