// In prisma v3 to find last record in mydb: const lastRecordObj = await prisma.mydb.findMany({ orderBy: { id: 'desc', }, take: 1 }) const lastRecord = lastRecordObj[0]