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