For relation from A to B via C, we can have relation as ManyToManyRelation.
In out example, A and B table are same
relationship: {
relation: Model.ManyToManyRelation,
modelClass: ${__dirname}/A,
join: {
from: 'A.uuid',
through: {
from: 'R.item_uuid_child',
to: 'R.item_uuid_parent',
extra: [
'A_uuid_child',
'A_uuid_parent',
'relation_p_to_c',
],
},
to: 'A.uuid',
},
}
Now, in our usecase, we can have 2 entries in R table while 1 entry in A table. Will that be feasible from objection to manage? Right now, its creating another entry in table A automatically if I tries to do POST.
Appreciate your support!
For relation from A to B via C, we can have relation as ManyToManyRelation.
In out example, A and B table are same
relationship: {
relation: Model.ManyToManyRelation,
modelClass:
${__dirname}/A,join: {
from: 'A.uuid',
through: {
from: 'R.item_uuid_child',
to: 'R.item_uuid_parent',
extra: [
'A_uuid_child',
'A_uuid_parent',
'relation_p_to_c',
],
},
to: 'A.uuid',
},
}
Now, in our usecase, we can have 2 entries in R table while 1 entry in A table. Will that be feasible from objection to manage? Right now, its creating another entry in table A automatically if I tries to do POST.
Appreciate your support!