samuk190 / localbase

A Firebase-Style Database ... Offline!
636 stars 84 forks source link

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

Closed umang-goyal closed 3 months ago

umang-goyal commented 1 year ago

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 ?

samuk190 commented 3 months ago

This issue is old, so I'm not sure if you still need help or not. If you still need help create a issue with label QUESTION

Thanks!