P
Prisma•4mo ago
thai

Relation field not appearing in model.createMany

//schema:
model ProjectPage {
id String @id @default(auto()) @map("_id") @db.ObjectId

//this does not appear as shown in the photo
stages ProjectStage[]

pageName String
Project Project @relation(fields: [projectId], references: [id])
projectId String @db.ObjectId
lastUpdatedAt DateTime @default(now())
}
//schema:
model ProjectPage {
id String @id @default(auto()) @map("_id") @db.ObjectId

//this does not appear as shown in the photo
stages ProjectStage[]

pageName String
Project Project @relation(fields: [projectId], references: [id])
projectId String @db.ObjectId
lastUpdatedAt DateTime @default(now())
}
Help would be appreciated, thanks. Yes I've run npx prisma generate.
No description
1 Reply
RaphaelEtim
RaphaelEtim•4mo ago
Hi @thai 👋 You cannot access relations in a createMany() or createManyAndReturn() query. See the documentation for detailed information.
Relation queries (Concepts) | Prisma Documentation
Prisma Client provides convenient queries for working with relations, such as a fluent API, nested writes (transactions), nested reads and relation filters.
Want results from more Discord servers?
Add your server