How to create and update and connect from a Many to Many relation with Prisma?
//schema.prisma model Post { id String @default(uuid()) name String @db.Text slug String @unique tags PostTags[] createdAt DateTime @default(now()) updatedAt DateTime @updatedAt } model PostTags { id String @default(uuid()) title String slug String @unique posts Post[] createdAt DateTime @default(now()) updatedAt DateTime @updatedAt } //api/route.ts import prismadb from “@/lib/prismadb”; import { auth } from “@clerk/nextjs/server”; import { […]
How to create and update and connect from a Many to Many relation with Prisma?
//schema.prisma model Post { id String @default(uuid()) name String @db.Text slug String @unique tags PostTags[] createdAt DateTime @default(now()) updatedAt DateTime @updatedAt } model PostTags { id String @default(uuid()) title String slug String @unique posts Post[] createdAt DateTime @default(now()) updatedAt DateTime @updatedAt } //api/route.ts import prismadb from “@/lib/prismadb”; import { auth } from “@clerk/nextjs/server”; import { […]
Query many-to-many relationship in Prisma with “some”
Related to this question