-
-
Notifications
You must be signed in to change notification settings - Fork 668
WhereClause.startsWithAnyOfIgnoreCase()
David Fahlander edited this page Feb 24, 2016
·
8 revisions
THIS METHOD IS PART OF NEXT RELEASE v1.3.0. CAN BE PREVIEWED IN BRANCH "es6"
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 |
Collection or WriteableCollection depending on table type
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