Expected behavior
Schema example:
let _schema = new mongoose.Schema({
tests: [{ type: mongoose.Schema.Types.ObjectId, ref: "Test" }]
}, {
timestamps: true,
usePushEach: true
});
const model = mongoose.model('User', schema);
It displays as expected the hasMany relationships in the UI.
When a Test document is assigned to a user, there is 2 delete actions available:
- “Dissociate the relationship”
- “Delete the test”
I expect:
-
the “Dissociate relationship” action to only remove the relationship in my User document and keep the Test document.
Request:DELETE /forest/Client/:clientId/relationships/screeningTests?delete=false
-
the “Delete the screening test” to remove the relationship in my User and also the Test document.
Request:DELETE /forest/Client/:clientId/relationships/screeningTests?delete=true
Actual behavior
Whether we select the “Dissociate the relationship” or “Delete the test” action, the same request is sent: DELETE /forest/Client/:clientId/relationships/screeningTests?delete=true
When looking at my database, the Test document is always removed but the relationship is not removed from the User.
Context
"meta": {
"database_type": "MongoDB",
"liana": "forest-express-mongoose",
"liana_version": "6.3.8",
"engine": "nodejs",
"engine_version": "10.22.1",
"framework": "other",
"framework_version": null,
"orm_version": "5.10.8"
}