IndexedDB resources
Introduction at Using IndexedDB.
Filtering on multiple fields at once
This is possible using compound indexes. Just define one index for each combination of query fields.
Filtering on arrays
We can filter on a value contained in an array. The index just has to be defined with multiEntry: true
. So every array item will get indexed separately.
Example:
objectStore.createIndex("tags","tags", {unique:false,multiEntry:true});
[..]
objectStore.add({ tags: ["Tag", "Another tag"] });
[..]
objectStore.index("tags").get("Another tag")[..]