Skip to content

IDs on subdocuments #917

Answered by hasezoey
luzzardik asked this question in Q&A
Mar 10, 2024 · 1 comments · 8 replies
Discussion options

You must be logged in to vote

was for me only used when calling getModelForClass, is it not the case ?
All Typegoose decoration is only effective at the point getModelForClass is called AFAIK.

to clarify, it is effective if you call buildSchema, not just getModelForClass; 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…

Replies: 1 comment 8 replies

Comment options

@hasezoey
Comment options

@luzzardik
Comment options

@smolinari
Comment options

@hasezoey
Comment options

Answer selected by luzzardik
@smolinari
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants