Skip to content

Retrieve indexes only #1269

Answered by dfahlander
bwbb asked this question in Q&A
Apr 11, 2021 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

There is no such possibility in the IndexedDB API. The closest you could come is to use a compound index that contains the properties you need and retrieve all those indexes.

const db = new Dexie('dbname');
db.version(1).stores({
  myTable: 'id, [id+firstName+lastName+age]'
});

const result = await db.myTable.orderBy('[id+firstName+lastName+age]').keys();

The result would give you:

[["id1", "firstName1", "lastName1", 21], ["id2", ...]]

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@bwbb
Comment options

@dfahlander
Comment options

@bwbb
Comment options

Answer selected by bwbb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants