Problem querying with OR operator

System Information
  • Strapi Version: 3.0.1
  • Operating System: macOS Big Sur v11.0.1
  • Database: Postgres
  • Node Version: v10.16.0
  • NPM Version: n/a
  • Yarn Version: 1.17.3

Hi

I simply want to query with _or operator but I can’t. If you have any idea, please help me :slight_smile: thanks.

URL
http://localhost:1337/restaurants?_where[_or][0][pricing_lt]=10&_where[_or][1][pricing_gt]=30

I got a following response.

{
“statusCode”: 400,
“error”: “Bad Request”,
“message”: “Your filters contain a field ‘_or’ that doesn’t appear on your model definition nor it’s relations”
}

image

@nack43 You are following the documentation from the latest version, but you are using an old version of strapi. I would recommend to upgrade your strapi to latest version, but keep in mind that you should follow all the migration guides if you want to keep the existing project:

https://strapi.io/documentation/developer-docs/latest/migration-guide/

If that’s a clean project and you don’t mind losing it, then I would recommend you to just create a new project:
npx create-strapi-app@latest new-project