#!/usr/bin/env node require('dotenv').config({ path: require('path').join(__dirname, '../.env') }); const { PrismaClient } = require('@prisma/client'); const p = new PrismaClient(); async function main() { const c = await p.course.findFirst({ where: { title: { contains: '数据分析' } }, orderBy: { createdAt: 'desc' }, select: { id: true, title: true, watermarkIcon: true, createdAt: true, createdAsDraft: true }, }); console.log(JSON.stringify(c, null, 2)); } main() .then(() => p.$disconnect()) .catch((e) => { console.error(e); process.exit(1); });