Filtering by dependent fields

System Information
  • Strapi Version: 4.5.5
  • Operating System: Ubuntu 22.04
  • Database: postgresql 8.6.0
  • Node Version: 18
  • NPM Version: 8.19.2

Hey!
I have entities:
‘characteristics_list’, ‘characteristics’
‘characteristics_list’ has an ‘Charact’ field of type ‘component’. This field (“Charact”), in turn, contains the “value” field, which is text, and the relative field, which refers to the “characteristic”.

This way I can create an unlimited number of “characteristics” such as width, height, etc. and after that in the “list of characteristics” I just select the desired “characteristics” and enter the value

This is how it looks like in creating ‘characteristic_list’

This is what it looks like in response:

Question: How to filter products whose “list of characteristics” field has the value “Character”, whose “value” is: 15, and the “characteristic” field refers to an entity whose “name” is “height”?

I’ve been fiddling with this all day and have tried all sorts of options at the ‘Query Engine API level’.
I started writing my own filtering function, but realized that then I would have to write pagination functions and much more, and this contradicts the paradigm that the great strapi follows
I am grateful to everyone who will respond. I really don’t know how to do it

After some digging, I realized that I needed a deep filter implementation.
I can have any number of “Charact” components. And I need to filter products by the values of one of them
For example:

strapi.db.query("api::product.product").findMany({
  where: {
    characteristic_list: {
      Charact: {
          num_value: {
            $eq: 15
          },
          where: {
            characteristic: {
              name: {
                $eq: 'height'
             }
            }
          }
      }
    }
 }
})

But it doesn’t work.
I guess nested filters don’t work

This task can also be solved by adding some plugin that allows you to automatically add one of the child fields to the parent component. For example, ‘child_name’ This will allow you to refer to the parent, see at a glance which child it has, without having to look into nested fields.

Does anyone know something similar?