Here is the code I currently use.
with getRawMany() - skip and take not works!
const data = await getRepository(Enquiry)
.createQueryBuilder('enq')
.select([
'enq.id AS id',
'enq.location AS location',
'enqStatus.name AS status'
])
.leftJoin('enq.status', 'enqStatus')
.skip(1)
.take(3)
.where(payload)
.getRawMany()
Try with limit and offset
const data = await getRepository(Enquiry)
.createQueryBuilder('enq')
.select([
'enq.id AS id',
'enq.location AS location',
'enqStatus.name AS status'
])
.leftJoin('enq.status', 'enqStatus')
.where(payload)
.offset(meta.page)
.limit(meta.pageSize)
.getRawMany()