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?
For example
- Removal of a DBRef from an array should remove that of DBRef in other collections and also pull out that DBRef from arrays of DBRef in different collections
- Removal of a document (DBRef from this document's Schema) also removes that of DBRef in other collections and also pull out that DBRef from arrays of DBRef in different collections
Are these possible? If so, how can I achieve these? Or any other Model design suggestions?