samchon / prisma-markdown

Markdown generator of Prisma, including ERD and descriptions
MIT License
393 stars 18 forks source link

Support MongoDB embedded objects. #19

Open csellis opened 6 months ago

csellis commented 6 months ago

Loving the tool, thank you! I'd like to know if you've covered MongoDB and Prisma.

It supports embedded document syntax which would be handy to have mapped.

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

// Address is an embedded document
type Address {
  street String
  city   String
  state  String
  zip    String
}
samchon commented 6 months ago

I've not used MongoDB through Prisma.

Can you give me a reproducible prisma schame file?

Also, how should I express the nested type in the document?

MongoDB is not relational database, so wonder whether that ERD is meaningful for the NoSQL MongoDB