How to implement pagination in nestjs with typeorm : <p>Anyway to get the total count and record with single query, instead of execute the query two times. Or how can i reuse the where condition in both query.</p>

<pre><code>async findAll(query): Promise&lt;Paginate&gt; {
    const take = query.take || 10
    const skip = query.skip || 0
    const keyword = query.keyword || ''

    const builder = this.userRepository.createQueryBuilder("user")
    const total = await builder.where("user.name like :name", { name: '%' + keyword + '%' }).getCount()
    const data = await builder.where("user.name like :name", { name: '%' + keyword + '%' }).orderBy('name', 'DESC').skip(skip).take(take).getMany();

    return {
        data: data,
        count: total
    }
}
</code></pre>

<p>{
    count: 10,
    data: [
    {
        id: 1,
        name: 'David'
    },
    {
        id: 2,
        name: 'Alex'
    }]
}</p>
