Files
Content-Hunter_BE/test-db-medium.ts
Harun CAN dee6e29cfd
Some checks failed
Backend Deploy 🚀 / build-and-deploy (push) Has been cancelled
main
2026-03-14 14:01:01 +03:00

19 lines
438 B
TypeScript

import { PrismaClient } from '@prisma/client';
const prisma = new PrismaClient();
async function main() {
const contents = await prisma.content.findMany({
where: {
OR: [
{ title: { contains: 'medium' } },
{ type: 'BLOG' }
]
},
orderBy: { createdAt: 'desc' },
take: 5
});
console.log(JSON.stringify(contents, null, 2));
}
main().catch(console.error).finally(() => prisma.$disconnect());