generated from fahricansecer/boilerplate-be
This commit is contained in:
18
test-db-medium.ts
Normal file
18
test-db-medium.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
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());
|
||||
Reference in New Issue
Block a user