-
Hi, I'm trying to use Subdocuments, but would there be an _id generated automatically by default ? |
Beta Was this translation helpful? Give feedback.
Answered by
hasezoey
Mar 12, 2024
Replies: 1 comment 8 replies
-
https://typegoose.github.io/typegoose/docs/api/decorators/prop/#_id But also read this: and this: https://typegoose.github.io/typegoose/docs/guides/advanced/change-id-type Scott |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
to clarify, it is effective if you call
buildSchema
, not justgetModelForClass
; ie the place where the schemas actually get build.or if i somehow mis-understood you question; i want to note that
@modelOptions
is a class decorator, not a property decorator.also maybe important to know is that when you use
@modelOptions
to set_id: false
, then anywhere you use that class (schema) you dont need to set_id: false
in@prop
, but also note that those options do not affect_id
if the class (schema) is used as the document root (or s…