Tech TutorBangla Web Documentation
Portfolio
HomeHTMLCSSTailwind CSSJavaScriptTypeScriptReactNext.jsNode.jsExpressSocket.IOExpoWordPressPostgreSQLPrismaPostgresNestJSMongoDBDockerTanStackTanStack TableRTK QueryGitGitHub
  • PrismaPostgres Documentation40টি অধ্যায়
প্রযুক্তি নির্বাচন
HomeHTMLCSSTailwind CSSJavaScriptTypeScriptReactNext.jsNode.jsExpressSocket.IOExpoWordPressPostgreSQLPrismaPostgresNestJSMongoDBDockerTanStackTanStack TableRTK QueryGitGitHub
  • Prisma Intro
  • Prisma vs Raw SQL
  • Setup & Install
  • Schema Basics
  • Models
  • Relations
  • Migrations
  • Prisma Client
  • Create & Upsert
  • Read Queries
  • Update & Delete
  • Query Filters
  • Sort & Pagination
  • Select & Include
  • Nested Writes
  • Transactions
  • Aggregation
  • JSON Fields
  • Raw SQL
  • TechShop Schema
  • TechShop Seed
  • Relations Advanced
  • Env Config
  • Global Client
  • Next.js + Prisma
  • Express API
  • Error Handling
  • Performance
  • Connection Pool
  • Prisma Studio
  • Deploy Migrations
  • TechShop Indexes
  • TechShop Cart
  • TechShop Stats API
  • Schema Evolution
  • Debugging
  • Common Mistakes
  • Best Practices
  • Interview Questions
  • Recap & Next
  1. Docs
  2. PrismaPostgres
  3. orderBy, take/skip, cursor
PrismaPostgresIntermediate

orderBy, take/skip, cursor

তালিকা সাজানো ও page-by-page — বড় dataset-এ cursor।

5টি অংশবাংলা ভাষায়
sort + skip/takets
ts
const page = 2;
const perPage = 10;

const products = await prisma.product.findMany({
  orderBy: [{ price: "desc" }, { name: "asc" }],
  skip: (page - 1) * perPage,
  take: perPage,
});

cursor pagination — অনেক operator-কে skip/offset-এর চেয়ে efficient (যথেষ্ট rows scan না হয়) আদর্শ:

const products = await prisma.product.findMany({
  where: { active: true },
  orderBy: { id: "asc" },
  cursor: { id: lastSeenId },
  take: 10,
  skip: 1, // cursor-row পুনরায় না
});
  • orderBy array — একাধিক column priority
  • skip বড় offset-এ ধীর — cursor-এ বদলান
  • count + findMany — total page জানতে
stable order

pagination-যদি data বদলায়, stable secondary (id)-সহ order দিন — না হলে offset-এ duplicate লাফিয়ে যেতে পারে।

শেষ প্যারায় নিজে practice করুন — কোড কপি করে নিজের এডিটরে চালিয়ে দেখুন।
আগেরFilter operators — where-এর অভিধানপরেরselect (কয়েকটি ক্ষেত্র) ও include (relation)
Tech Tutor

বাংলায় ওয়েব ডেভেলপমেন্ট ডকুমেন্টেশন শিখুন — ধাপে ধাপে।

Homeসব ডকুমেন্টেশনQuick Startআমার নোটস

© 2026 Tech Tutor. বাংলায় শিখুন, বাংলায় গড়ুন।

mdanamolhasan1998@gmail.com