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
Preview feature feedback: MongoDB support (mongoDb
)
#8241
Comments
This comment was marked as outdated.
This comment was marked as outdated.
This comment has been minimized.
This comment has been minimized.
Hi! I think it would be great to have a way to model nested fields, since it's something quite common when using MongoDB. At this moment, I would have to define two models, for example: model Match {
id String @id @default(dbgenerated()) @map("_id") @db.ObjectId
movements Movement[]
}
model Movement {
id String @id @default(dbgenerated()) @map("_id") @db.ObjectId
match UserMatch? @relation(fields: [matchId], references: [id])
matchId String? @db.ObjectId
date DateTime
} And it would be great to have something like this: model Match {
id String @id @default(dbgenerated()) @map("_id") @db.ObjectId
movements [
{
date DateTime
}
]
} Hope this is useful, thanks! |
Hey @Lefcott, Thanks for sharing your feedback. We have an open issue for embedded documents which would allow you to type nested objects. Feel free to give it a thumbs up and share any thoughts you have on the design proposal. |
So is introspections supported or not? The getting started tutorial has you go through the steps of introspecting an existing MongoDB but on the MongoDB connector page is says it's not supported. Is there at least some support for introspection for MongoDB? |
Introspection for MongoDB was added to the |
Hi! I have existing DB, which have collections, created by import from TSV files. Now i just trying to connect Prisma and there is the question. Can i provide collection name, when i describing model in schema? Or i need to describe all fields in model, to make query working. For now i describe few fields in model, but existing mongo document have more fields, and Prisma query doesn't work. Maybe i miss something? |
@Skellord so here if I understand, you only specified some fields in your model in the Prisma schema, and you are trying to query using the Prisma Client, but it fails? I can recommend introspecting the collection using |
@Jolg42 thanks for answering. Yes, you got me right, and yes, i miss introspecting step -_-. Now it's working. Thank you again, and sorry for wasting time. |
MongoDB General Availability shipped in 3.12.0! If you run into any issues, please open a new issue. Thanks everyone! |
Please share your feedback about the
mongoDb
functionality released in v2.27.0 in this issue.If you have any questions, don't hesitate to ask them in the
#prisma-client
channel in the Prisma Slack.The text was updated successfully, but these errors were encountered: