#Mongoose cascade delete

1 messages · Page 1 of 1 (latest)

oblique veldt
#

Hello all,

I tried to implement a cascade delete in mongoose. Let me share my investigation results:
https://github.com/ragnta/dog_owner
My questions are the followings:
Is there any other way to implement the same behavior?
I guess my solution is very ugly, because I have to export the ownerProviders because without it the OwnerService can't reach the model from the DogModule
I tried the implement the same behavior with the MongooseModule, but in that case I can't export the Model<Owner>.
Feel free to share any remarks regarding to my project. Thank you!

GitHub

Contribute to ragnta/dog_owner development by creating an account on GitHub.

tropic vale
#

Well I don't know how to cascade delete

#

But

#

In case u are not able to export Model<Owner>

#

For this export the mongoose module from the Owner module

#

And u will be able to import the Model<Owner> in other modules