With Dexie, can I get all objects in a table where an array field has a specific value as one of its elements?
问题 I have a table where each object has a field that is an array of strings: for example, { people: ['John', 'Bob', 'Sue'] } . I need all objects in the table that have 'Sue' in the people array. Can Dexie do this? 回答1: Yes, using MultiEntry indexes you can do exactly that. const db = new Dexie("testdb"); db.version(2).stores({ groups: 'id, *people' }); async function addRow() { await db.groups.add({id: 1, people: ['John', 'Bob', 'Sue']}); } async function findSuesGroups() ( return await db