$searchOne

Filter and retrieve data from the table based on the provided conditions.

Query
Parameter's

$where

<StaticProps>

$options

For example:

var filteredMember = await Member.$searchOne({
    $where: {
        username: {
            $eq: 'JohnDoe',
        },
        badges: {
            $in: [['Admin', 'Moderator']]
        }
    },
    $options: {
        $limit: 20,
        $offset: 10,
        $sort: {
            isPremium: -1
        },
        $cache: true
    }
});

Last updated