$distinct
Filter and retrieve distinct values from the table based on the provided field, conditions, and options.
Query
Parameter's
$field
keyof
<StaticProps>
$where
<StaticProps>
$options
⇒ <FindOptions>
For example:
var values = await Member.$distinct({
$field: ['userId', 'username', 'displayName'],
$where: {
createdAt: {
$gte: new Date('2021-01-01')
}
},
$options: {
$cache: true
}
});
Last updated