This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Is there a way to create a nested path instead of a subdocument? #611
Labels
question
Qustions about how to use stuff
Is it possible to create a nested path as opposed to a subdocument and have tracking etc.. function?
In my case, I'm converting complex nested schemas to Typegoose, but am being forced to change what were previously basic nested paths into many separate nested subdocuments. I would be OK with this, but there are behavioral differences of subdocuments versus nested path in mongoose (I'm sure you know this already). It looks like Typegoose requires all nested entities to be subdocuments.
The main behavioral difference is that that a nested path is inherently lean, while a nested document comes with it's own wrapper and tracking, which is unnecessary in the vast majority of cases and messes up a lot of existing document parsing logic that we have in place on our project.
On the flip side, if I create a basic nested path inside of the parent, it doesn't track property changes with Typegoose.
Is there a way to force a nested entity to be a simple nested path and still function properly with Typegoose?
If not, is this something you would consider adding as a custom decorator?
Thanks,
Versions
I am running 8.3.0 on NodeJS 14 with Typescript 4.4.3. Mongoose is 5.13.8.
The text was updated successfully, but these errors were encountered: