Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getting error #72

Open
arsajib33 opened this issue Oct 21, 2024 · 2 comments
Open

getting error #72

arsajib33 opened this issue Oct 21, 2024 · 2 comments

Comments

@arsajib33
Copy link

https://prisma-editor.vercel.app/schema/10179

above code i copied from peisma website but your app is showing error

@mohammed-bahumaish
Copy link
Owner

i don't have access to the above shared schema, what's the error you see, and could you share a minimal schema to reproduce the error?

thanks for reporting! @arsajib33

@arsajib33
Copy link
Author

datasource db {
provider = "mongodb"
url = env("DATABASE_URL")
}

generator client {
provider = "prisma-client-js"
}

model Post {
id String @id @default(auto()) @Map("_id") @db.ObjectId

MongoDB @default(auto()) fields must have ObjectId native type.

slug String @unique
title String
body String
author User @relation(fields: [authorId], references: [id])
authorId String @db.ObjectId
comments Comment[]
}

model User {
id String @id @default(auto()) @Map("_id") @db.ObjectId
email String @unique
name String?
address Address?
posts Post[]
}

model Comment {
id String @id @default(auto()) @Map("_id") @db.ObjectId
comment String
post Post @relation(fields: [postId], references: [id])
postId String @db.ObjectId
}

// Address is an embedded document
type Address {
street String
city String
state String
zip String
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants