$regexp

Filter records where a column’s value matches a specified regular expression pattern. The $regexp method is used for pattern matching in strings, allowing you to search for complex or dynamic text patterns within a column’s value. This is useful for advanced text searches that go beyond simple string matching.

await Member.$search({
    $where: {
        username: {
            $regexp: '^john|doe$'
        }
    }
});

Last updated