WhereClause.startsWithAnyOfIgnoreCase() - zuki/Dexie.js GitHub Wiki

Since v1.3.0

Syntax

table.where(indexOrPrimKey).startsWithAnyOfIgnoreCase(array) or
table.where(indexOrPrimKey).startsWithAnyOfIgnoreCase(str1, str2, strN, ...)

Parameters

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

Return Value

Collection or WriteableCollection depending on table type

Remarks

Searches given index for given prefixes, ignoring case differences.

Sample

// 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);
  });
⚠️ **GitHub.com Fallback** ⚠️