In Mongoose,
I can declare Schemas and also I can use
which is simply putting ObjectId or an Array of ObjectId
and populate(get) those items.
I think it would be problem when a DBRef removal is needed.
Is there any way to possibly sync removal of DBref?
Are these possible? If so, how can I achieve these? Or any other Model design suggestions?
You can use schema.pre('remove', ...
middleware to implement your own cascaded removal of ObjectId references in other collections. this._id
identifies the document being removed in your middleware function.