Dexie.js: How do you get ALL records from a table

Created on 15 Jan 2016  路  4Comments  路  Source: dfahlander/Dexie.js

It might seem silly, but I can't find it anywhere, the documentation always assumes that you want to retrieve a certain value matching a key, but what if I want all the records from a table (which I think is a pretty common case), I should be able to use something like Table.get(*) or just Table.get().
I appreciate any help. Thanks!

Most helpful comment

db.table.toArray()

or

db.table.each(callbackFn);

All 4 comments

db.table.toArray()

or

db.table.each(callbackFn);

Yes I found it in the documentation a little bit afterwards, what a shame it was right there. Thank you for your support!!

but this only returns a promise what if I need to return the array itself?

@veenitchauhan This is the nature of asynchronic APIs. Have a look at this tutorial that guides you about how to use promises.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dfahlander picture dfahlander  路  4Comments

dmlzj picture dmlzj  路  3Comments

nezcich picture nezcich  路  3Comments

asdip138 picture asdip138  路  3Comments

kamleshchandnani picture kamleshchandnani  路  4Comments