Text comparison queries can be applied to String properties to determine if a portion or all of a property’s value matches a given comparison value. For example:

firstName STARTS WITH "h"
lastName ENDS WITH "son"
phoneNumber CONTAINS "33"
state EQUALS "Utah"

Be sure to enclose the comparison value in double quotes; otherwise, the RQL parser assumes the operand refers to a property name rather than a value.

By default, text comparison queries are case-sensitive. To perform a case-insensitive comparison, use the IGNORECASE directive. For example:


You can also make a negative text comparison query:


Note: Negated pattern match queries can cause performance problems. Consider the queries you want to use and plan your database indexes accordingly to avoid table scans. STARTS WITH and EQUALS queries can be optimized easily with database indexes, while other pattern match queries generally cannot be. Case-insensitive pattern matching can also affect the ability of the database to optimize the query.