Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- OCR
- game
- Python
- Express
- 게임
- nodejs
- AWS
- Dinosaur
- flask
- 정렬
- TypeScript
- typeORM
- nestjs
- mongoose
- Queue
- jest
- MySQL
- dfs
- Sequelize
- cookie
- 자료구조
- react
- 공룡게임
- GIT
- Bull
- Nest.js
- MongoDB
- class
- JavaScript
Archives
- Today
- Total
목록TAKE (1)
포시코딩
3월3일 - TypeORM에서의 pagination (limit, offset)
개요 Nest.js에서 TypeORM을 쓰며 pagination(페이지네이션)을 구현하게 되어 새로 알게된 부분을 정리해보았다. Basic Repository async findAllUsers({ id, page }: FindAllUserInput): Promise { // ...생략 const allUsers = await this.users.find({ where: { id }, take: 10, skip: (page - 1) * 10, }); // ...생략 } 기본 Repository를 쓸 경우에 find를 쓰면서 where 처럼 take, skip을 써서 pagination을 구현하는 경우이다. take: 한 번에 보여줄 개수 - mysql에서의 limit을 생각하면 된다. skip: 말 그대로..
TIL
2023. 3. 3. 11:28