localbase icon indicating copy to clipboard operation
localbase copied to clipboard

How to get a list of document in a collection based on mulitple keys and not just id.

Open umang-goyal opened this issue 2 years ago • 0 comments

My collection is something like :

'key_1' |  { id: 1, name: 'max', dept: 'engineering' }
'key_2'. | { id: 2, name: 'manu', dept: 'finance' }
'key_3' | { id: 3, name: 'milan', dept: 'engineering' }

I want to get all the employees with dept === 'engineering'. How can we do it using localbase ?

In indexdb there is feature to add indexes. eg. objectStore.createIndex('dept_index', ['dept'], {unique: false});

How to mimic this in localbase ?

umang-goyal avatar Jun 18 '23 17:06 umang-goyal