I have the following table schema:
db.version(1).stores({
sales: "[item_id+date],sales"
});
Where the combination of date
and item_id
must be unique. How can I get all the records for a given item_id
using the where
clause (disregarding the date)?
The following produces an error:
db.sales.where('item_id').equals(some_item_id)
Unhandled rejection: SchemaError: KeyPath item_id on object store sales is not indexed
db.sales.where('[item_id+date]').between ([some_item_id, -Infinity], [some_item_id, Dexie.maxKey])