Skip to main content

Like

Like is used with Where to search for a specified pattern in a column. Currently We support only '%' character.

Some Examples of Like supported by JsStore -

  • Like 'a%' : Finds any values that starts with "a".
  • Like '%a' : Finds any values that ends with "a".
  • Like '%a%' : Finds any values that contains "a" at any position.

Sql

Select * From Table_Name;
Where
Column_Name Like 'a%'

JsStore

var results = await connection.select({
from: "Table_Name",
where: {
Column_Name: {
like: 'a%'
},
}
});
//results will be array of objects.
console.log(results);

Example

tip

If like does not fulfill your requirements, then you can use regex. Under the hood like also uses regex which allows you to search for any kind of pattern.