$contains

Filter records where a column’s value contains the specified element or substring. The $contains method is used to check if a given value exists within a text field, array, or set, making it useful for searching within more complex data types like strings, arrays, or JSON objects.

await Member.$search({
    $where: {
        badges: {
            $contains: ['VIP','CEO']
        }
    }
});

Last updated