[v3] API filter parameters AND and OR

System Information
  • Strapi Version: 3.6.8
  • Operating System: docker image
  • Database: sqlite
  • Node Version: 14.16.0
  • NPM Version: 6.14.11
  • Yarn Version: 1.22.5

Hi all,

I need an exemple for mixing AND and OR filters on API parameters. The current documentation shows how to do (AND) OR (AND) but I need to do the opposite (OR) AND AND.

My dataset is

[
    {
        "id": 16,
        "Date": null,
        "DayOfWeek": 4,
        "From": 0,
        "To": 1020,
        "created_at": "2022-08-17T09:05:53.389Z",
        "updated_at": "2022-08-17T09:05:53.396Z"
    }
]

I need to query like this :
(Date=2022-09-09 OR DayOfWeek=4) AND From<=867 AND To>=867

I can do (Date=2022-09-09 OR DayOfWeek=4) as ?_where[_or][0][DayOfWeek_eq]=4&_where[_or][1][Date_eq]=2022-09-09

I can do From<=867 AND To>=867 as _where[0][From_lte]=867&_where[1][To_gte]=867

But I cannot combine both, it always fail.

Can you give me an example of AND and OR that works please ?

Thanks

I found out. I post the soluce here if someone has the same issue.
The AND is implicit so it works with

?_where[0][_or][0][DayOfWeek_eq]=0&_where[0][_or][1][Date_eq]=2022-09-12T00:00:00.000Z&_where[1][From_lte]=840&_where[2][To_gte]=840