I have some data like this
[
{
code: 'string1',
id: 1,
body: {\*some data*\}
},
{
code: 'string2',
id: 2,
body: {\*some data*\}
},
.......
]
Now, I use this to get results.
const compStore = db.createObjectStore(COMP_STORE, {
keyPath: ['id', 'code'],
autoIncrement: false,
});
const getConfigByAPPID = async (appId: number) => {
try {
const db = await this.dbIns;
const keyrange = IDBKeyRange.only([1, 'string1']);
const components = await db.getAll(COMP_STORE, keyrange);
console.log(components);
} catch (error) {
console.log(error);
}
};
It only returns one data.Have some way to get multi-data? like this
IDBKeyRange.only([1, '*'])
I also tried to use the index to search the table, but index.iterate is undefined.