These are queries that 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"

When you use text comparison queries, be sure to enclose the comparison value in double quotes, as in the examples above; otherwise, the RQL parser assumes the comparison term refers to a property name rather than a property value.

The optional IGNORECASE directive can be applied to any of these queries to perform a case-insensitive comparison:

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

You can also make a negative text comparison query, like:

NOT firstName STARTS WITH IGNORECASE "j"

Be aware, though, that negated pattern match queries have the potential to cause performance problems. You should 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 using database indexes. The other pattern match queries generally cannot be. Likewise case-insensitive pattern matching may affect the ability of the database to optimize the query.

 
loading table of contents...