-
I have an existing collection of documents with an array of subdocuments. I'm trying to create a schema for this collection retroactively, e.g: @modelOptions({
schemaOptions: {
_id: false,
toJSON: { virtuals: true },
toObject: { virtuals: true },
},
})
class ChildClass {
@prop()
public description: string;
}
class ParentClass {
@prop({ type: () => [ChildClass] })
public children: ChildClass[];
}
|
Beta Was this translation helpful? Give feedback.
Answered by
hasezoey
Jul 7, 2022
Replies: 1 comment 5 replies
-
What version are you using and what compiler with what options? also, could you maybe provide a sample document? |
Beta Was this translation helpful? Give feedback.
5 replies
Answer selected by
Mosquid
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What version are you using and what compiler with what options? also, could you maybe provide a sample document?