Lime Web Components API Documentation - v7.4.0
    Preparing search index...

    Enumeration Operator

    Operators for building filter expressions in Lime CRM queries.

    The Operator enum defines all available operators for constructing Expressions. Operators are divided into four categories:

    1. Logical operators - Combine multiple expressions (AND, OR, NOT)
    2. Comparison operators - Compare property values (=, !=, <, >, <=, >=)
    3. Text operators - Match part of a text value (BEGINS, LIKE, ENDS)
    4. Membership operator - Check against multiple values (IN)

    The same operators are used in filters the server evaluates, such as Query.filter and LoadOptions.filter, and in filters the web client evaluates locally against an object it has already loaded. The two do not compare text the same way. The client ignores case, while the server compares as the database does. Treat case sensitivity as unspecified and do not build logic that depends on it.

    Each operator carries its own example below. This one shows what a single member cannot, how the categories combine into one filter.

    import { Expression, Operator } from '@limetech/lime-web-components';

    const highPriorityOpenDeals: Expression = {
    op: Operator.AND,
    exp: [
    {
    op: Operator.OR,
    exp: [
    { key: 'status', op: Operator.EQUALS, exp: 'open' },
    { key: 'status', op: Operator.EQUALS, exp: 'in_progress' },
    ],
    },
    { key: 'value', op: Operator.GREATER_OR_EQUAL, exp: 100_000 },
    { key: 'company.name', op: Operator.LIKE, exp: 'Tech' },
    {
    op: Operator.NOT,
    exp: { key: 'is_archived', op: Operator.EQUALS, exp: true },
    },
    ],
    };
    Index

    Enumeration Members

    AND: "AND"

    Logical AND: All sub-expressions must be true.

    Used in AndOrExpression to require all conditions to match.

    import { AndOrExpression, Operator } from '@limetech/lime-web-components';

    const activeAndWorthOver50k: AndOrExpression = {
    op: Operator.AND,
    exp: [
    { key: 'status', op: Operator.EQUALS, exp: 'active' },
    { key: 'value', op: Operator.GREATER, exp: 50_000 },
    ],
    };
    BEGINS: "=?"

    Text operator: Property begins with value.

    Matches objects where the text property starts with the specified value. The operator already decides where the value has to appear, so pass the fragment on its own rather than a pattern.

    import { BasicExpression, Operator } from '@limetech/lime-web-components';

    const supportAddress: BasicExpression = {
    key: 'email',
    op: Operator.BEGINS,
    exp: 'support@',
    };
    ENDS: "=$"

    Text operator: Property ends with value.

    Matches objects where the text property ends with the specified value. The operator already decides where the value has to appear, so pass the fragment on its own rather than a pattern.

    import { BasicExpression, Operator } from '@limetech/lime-web-components';

    const acmeAddress: BasicExpression = {
    key: 'email',
    op: Operator.ENDS,
    exp: '@acme.com',
    };
    EQUALS: "="

    Equality operator: Property equals value.

    Matches objects where the property equals the specified value. Works with strings, numbers, booleans, and null.

    When the web client evaluates the filter and the property holds several values, such as a relation, the comparison matches if any one of them equals the value.

    import { BasicExpression, Operator } from '@limetech/lime-web-components';

    const statusIsActive: BasicExpression = {
    key: 'status',
    op: Operator.EQUALS,
    exp: 'active',
    };
    GREATER: ">"

    Greater than operator: Property is greater than value.

    Matches objects where the property value is strictly greater than the specified value. Works with numbers and with dates.

    import { BasicExpression, Operator } from '@limetech/lime-web-components';

    const worthOver50k: BasicExpression = {
    key: 'value',
    op: Operator.GREATER,
    exp: 50_000,
    };
    GREATER_OR_EQUAL: ">="

    Greater than or equal operator: Property is greater than or equal to value.

    Matches objects where the property value is greater than or equal to the specified value.

    import { BasicExpression, Operator } from '@limetech/lime-web-components';

    const worthAtLeast50k: BasicExpression = {
    key: 'value',
    op: Operator.GREATER_OR_EQUAL,
    exp: 50_000,
    };
    IN: "IN"

    Membership operator: Property matches any value in a list or filter.

    Used in InExpression to check if property equals any value in an array, or in InFilterExpression to check against results from a saved filter. Each value in the list is compared the same way Operator.EQUALS compares one.

    import {
    InExpression,
    InFilterExpression,
    Operator,
    } from '@limetech/lime-web-components';

    const inValueList: InExpression = {
    key: 'status',
    op: Operator.IN,
    exp: ['open', 'in_progress', 'waiting'],
    };

    const inFilterResult: InFilterExpression = {
    type: 'filter',
    key: 'owner',
    op: Operator.IN,
    exp: 'sales_team_filter',
    };
    LESS: "<"

    Less than operator: Property is less than value.

    Matches objects where the property value is strictly less than the specified value. Works with numbers and with dates.

    import { BasicExpression, Operator } from '@limetech/lime-web-components';

    const worthUnder1k: BasicExpression = {
    key: 'value',
    op: Operator.LESS,
    exp: 1000,
    };
    LESS_OR_EQUAL: "<="

    Less than or equal operator: Property is less than or equal to value.

    Matches objects where the property value is less than or equal to the specified value.

    import { BasicExpression, Operator } from '@limetech/lime-web-components';

    const upToThirty: BasicExpression = {
    key: 'age',
    op: Operator.LESS_OR_EQUAL,
    exp: 30,
    };
    LIKE: "?"

    Text operator: Property contains value.

    Matches objects where the text property contains the specified value anywhere in the string. The operator already decides where the value has to appear, so pass the fragment on its own rather than a pattern.

    import { BasicExpression, Operator } from '@limetech/lime-web-components';

    const nameContainsAcme: BasicExpression = {
    key: 'name',
    op: Operator.LIKE,
    exp: 'Acme',
    };
    NOT: "!"

    Logical NOT: Inverts the result of an expression.

    Used in NotExpression to exclude matching objects. The exp must be another expression. To negate a single comparison, use Operator.NOT_EQUALS rather than wrapping it in a NOT.

    import { NotExpression, Operator } from '@limetech/lime-web-components';

    const notClosed: NotExpression = {
    op: Operator.NOT,
    exp: { key: 'status', op: Operator.EQUALS, exp: 'closed' },
    };
    NOT_EQUALS: "!="

    Inequality operator: Property does not equal value.

    Matches objects where the property is not equal to the specified value.

    import { BasicExpression, Operator } from '@limetech/lime-web-components';

    const statusIsNotClosed: BasicExpression = {
    key: 'status',
    op: Operator.NOT_EQUALS,
    exp: 'closed',
    };
    OR: "OR"

    Logical OR: At least one sub-expression must be true.

    Used in AndOrExpression to match if any condition is true.

    import { AndOrExpression, Operator } from '@limetech/lime-web-components';

    const urgentOrHighPriority: AndOrExpression = {
    op: Operator.OR,
    exp: [
    { key: 'priority', op: Operator.EQUALS, exp: 'urgent' },
    { key: 'priority', op: Operator.EQUALS, exp: 'high' },
    ],
    };