All the logic handling the registering/deregistering or addition/deletion of events can be handed off to mongoose middleware.
I think we would only need post hooks. These things are ideal for handling interdependent collections. Perhaps we could reduce the amount of code we have in our routes/api/models files.
Also look at mongoose's ref property. Fields of ObjectID type get a ref attribute referencing the other collection. I was hoping this would make getting the referenced document comparatively easier.
All the logic handling the registering/deregistering or addition/deletion of events can be handed off to mongoose middleware.
I think we would only need post hooks. These things are ideal for handling interdependent collections. Perhaps we could reduce the amount of code we have in our
routes/api/modelsfiles.Also look at mongoose's
refproperty. Fields of ObjectID type get a ref attribute referencing the other collection. I was hoping this would make getting the referenced document comparatively easier.