prisma-generator-nestjs-dto icon indicating copy to clipboard operation
prisma-generator-nestjs-dto copied to clipboard

Support Types in Mongodb Prisma

Open masterbater opened this issue 2 years ago • 3 comments

masterbater avatar May 21 '22 04:05 masterbater

In case of Enum Array it does @ApiProperty({ enum: X[] }) wheras it should be @ApiProperty({ enum: [X] })

n0t-r0n1t avatar Feb 19 '23 15:02 n0t-r0n1t

I think these are two different issues.

The issue reported by @n0t-r0n1t still persists, I'm currently running into the same problem and it warrants its own ticket.

The original issue in this topic is something I've already brought up with another generator library for Prisma.

Starting with version 3.10.0 Prisma started supporting embedded documents in MongoDB.

This requires declaring a type in the schema like this:

// schema.prisma

model Product {
  id     String  @id
  name   String
  photos Photo[]
}

type Photo {
  height Int
  width  Int
  url    String
}

This will cause the following error to be thrown:

Error: related model 'Photo' for 'Product.photos' not found

gwesterman avatar May 07 '23 06:05 gwesterman

Same problem for me, any help ? image result : Error: related model 'TokenData' for 'Community.tokenData' not found

benjibenoit avatar Jun 14 '23 14:06 benjibenoit