where condition in loopback 4 with column of other models

235 Views Asked by At

I have a query made through the filter on multiple models in cascade. I would like to use a column of the first level (ModelA) in the where conditions of the underlying levels, is it possible?

example:

const customFilter = {
    
        include:[{
            {
             relation: 'modelB',
             scope:{
                where: _this_condition_with_column_of_modelA_
             }
        }]
}
this.repository.find(customFilter) // repository on modelA
0

There are 0 best solutions below