find operator
The find
operator is the most powerfull one of all the default operators. It accepts a wide range of values including all types of specific values, Regex Statements and Object/Array search values.
The Regex Statement is marked with a beginning and ending /
. So for example value: 'Blue'
will find all items that are exactly Blue. Whereas value: /Blue/
will find any items that contain Blue in the queried attribute. You can put any Regex pattern in there. But beware that it might be a costly query for large datasets.
When working with data that includes special characters commonly used in regular expressions such as $
, ^
, and ()
, it is important to escape them to ensure they do not interfere with your query. To simplify this process, you can utilize our provided utility function:
import { escapeRegExp } from '@dcupl/common';