You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ ] Regression
[ ] Bug report
[X] Feature request
[X] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.
Current behavior
I want to write a strongy modularized App that uses mongoose as a database. There is a collection, let's say Container, that is agnostic about where it is referenced. It might be in no other module in one or in multiple ones.
The can be an unknown amout of things that needs to be done when a Container is checked or removed. One module might want to protect a container from being removed, when it is still referenced, while another needs to remove an instance in itself. Or a module needs to realize that a field on a Container has been changed and change one on its own.
All this could be achieved with Schema hooks in vanilla mongoose. I just need to expose the Schema of Container before the call to get the Model of the Schema.
Unfortunately I do not see any point in time where I could be sure, to get a Schema, but where ot Model has been created of this. Would it be possible to expose this at a defined point during startup, so that other models could plant their hooks into the already existing Schema?
I'm submitting a...
Current behavior
I want to write a strongy modularized App that uses mongoose as a database. There is a collection, let's say Container, that is agnostic about where it is referenced. It might be in no other module in one or in multiple ones.
The can be an unknown amout of things that needs to be done when a Container is checked or removed. One module might want to protect a container from being removed, when it is still referenced, while another needs to remove an instance in itself. Or a module needs to realize that a field on a Container has been changed and change one on its own.
All this could be achieved with Schema hooks in vanilla mongoose. I just need to expose the Schema of Container before the call to get the Model of the Schema.
Unfortunately I do not see any point in time where I could be sure, to get a Schema, but where ot Model has been created of this. Would it be possible to expose this at a defined point during startup, so that other models could plant their hooks into the already existing Schema?
Thanks
Environment
The text was updated successfully, but these errors were encountered: