I have an IDB object store "feeditems" with the keypath ["feed_id","item_id"], and inserting objects with os.put({feed_id:1,item_id:2,text:"foo"});
works fine.
Now I'd like to get a count of all feeditems where the feed_id is 13. The problem is that even the usually good MDN docs at https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore only say that the key parameter is "The key or key range that identifies the records to be counted.", yet a os.count({feed_id:13})
fails with a DataError
exception "The parameter is not a valid key.".
So, how do I get the count of (and later, how do I iterate through) all the items with feed_id==x?
Note that the uniqueness is only combined for feed_id and item_id - there may very well be one entry with {feed_id:1,item_id:1} and one with {feed_id:2,item_id:1}!