-
-
Notifications
You must be signed in to change notification settings - Fork 668
WhereClause.startsWithAnyOfIgnoreCase()
David Fahlander edited this page Nov 25, 2016
·
8 revisions
Since v1.3.0
table.where(indexOrPrimKey).startsWithAnyOfIgnoreCase(array) or
table.where(indexOrPrimKey).startsWithAnyOfIgnoreCase(str1, str2, strN, ...)
indexOrPrimKey: String | Name of an index or primary key registered in Version.stores() |
array | Array of prefixes (strings) to look for |
str1, str2, strN | Prefixes (strings) to look for |
Searches given index for given prefixes, ignoring case differences.
// Define DB
var db = new Dexie("friendsDB");
db.version(1).stores({
friends: '++id,fistName,lastName'
});
// Add some values
db.friends.bulkAdd([{
firstName: "Foo",
lastName: "Barfly"
},{
firstName: "Bart",
lastName: "Foofie"
}]);
// Query values
db.friends.where('lastName').startsWithAnyOfIgnoreCase(['foo','bar'])
.toArray(function(result) {
console.log("Found: " + result.lastName);
});
Dexie.js - minimalistic and bullet proof indexedDB library