startsWith( )


Refines a query to match items where the specified property starts with the specified value.

The startsWith() function refines a DiscountRulesQueryBuilder to match only items where the value of the specified propertyName starts with the specified string. Matching with startsWith() is case-sensitive, so 'TEXT' doesn't start with 'text'. You can only use startsWith() with a property whose value is a string.

Method Declaration
Copy
function startsWith(
  propertyName: string,
  value: string,
): DiscountRulesQueryBuilder;
Method Parameters
propertyNamestring

Property whose value is compared with string.


valuestring
Returns
JavaScript
const query = discountRules.queryDiscountRules.startsWith("_id", "L");
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?