Pretty much the title.
Here's the function that looks for relational fields:
Model.whichFieldsAreRelational = function (where) {
return _.keys(where).filter((key) => {
const headKey = key.split('.')[0];
return Model.relations[headKey];
});
};
if my relational fields are nested like this:
{
where: {
or: [
{
'relation.field': someOperator
}
]
}
}
they will be ignored. In simple cases you can flatten the 'where' and bring relation fields to the upper level, but it isn't always possible.
Pretty much the title.
Here's the function that looks for relational fields:
Model.whichFieldsAreRelational = function (where) { return _.keys(where).filter((key) => { const headKey = key.split('.')[0]; return Model.relations[headKey]; }); };if my relational fields are nested like this:
{ where: { or: [ { 'relation.field': someOperator } ] } }they will be ignored. In simple cases you can flatten the 'where' and bring relation fields to the upper level, but it isn't always possible.