limit 100
This commit is contained in:
@ -167,7 +167,8 @@ async function main() {
|
||||
)
|
||||
.where('contact.id IS NULL')
|
||||
.andWhere('customer.email IS NOT NULL')
|
||||
.andWhere('customer.email != :emptyEmail', { emptyEmail: '' });
|
||||
.andWhere('customer.email != :emptyEmail', { emptyEmail: '' })
|
||||
.limit(100);
|
||||
} else {
|
||||
// Find customers with exactly N email contact records
|
||||
customersQuery = customersQuery
|
||||
@ -180,7 +181,8 @@ async function main() {
|
||||
.where('customer.email IS NOT NULL')
|
||||
.andWhere('customer.email != :emptyEmail', { emptyEmail: '' })
|
||||
.groupBy('customer.id')
|
||||
.having('COUNT(contact.id) = :count', { count: emailCount });
|
||||
.having('COUNT(contact.id) = :count', { count: emailCount })
|
||||
.limit(100);
|
||||
}
|
||||
|
||||
const filteredCustomers = await customersQuery.getMany();
|
||||
|
||||
Reference in New Issue
Block a user