like static method
Matches documents where the field's value matches a regular expression.
The options
parameter can be used to set regex options (e.g., 'i'
for case-insensitive).
Example:
var query = DQ.like('pattern', options: 'i'); // { '\$regex': 'pattern', '\$options': 'i' }
Implementation
static Map<String, Object?> like(String value, {String options = 'i'}) {
value = _escapeRegex(value);
return {
'\$regex': value,
'\$options': options,
};
}