IndexedDB: Query index where value “contains”
-
29-10-2019 - |
Question
I think the answer is "you can't do it that way", but I wanted to be sure. Let's say I have an object:
var person = {
name: 'Joe',
phoneNumbers: [ '5555554455', '4445554455' ]
};
I want to create an index on phoneNumbers:
objectStore.createIndex('phoneNumberIndex', 'phoneNumbers');
Later I want to query for persons with a particular phoneNumber:
index.get('4445554455').onsuccess = function(event) {
// Anything?
};
Will that produce a result? If not, is there another way to do this?
No correct solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow