Using indexeddb and idb promise library.
I have this objectstore that I create called storeMappings
along with the index inUse
. I then populate the store with some records.
Everything works as it should except for one issue. The index inUse
does not show any data. Any ideas why?
const _addStoreMappings = async (db) => {
const mappings = db.createObjectStore('storeMappings', {
keyPath: 'id',
autoIncrement: true,
});
await mappings.createIndex('inUse', 'inUse');
await mappings.add({ store: `store0`, name: `foo store`, inUse: true });
Array.fromAsync({ length: 14 }, (_, i) => (
mappings.add({ store: `store${++i}`, name: '', inUse: false })
));
};