odata

Does OData query support nested filters with AND/OR operators?


Does OData query support nested filters with AND/OR operators?

By nested query, I mean query similar to this:

((FieldA < 50 OR FieldA > 100) AND FieldB == "MyString")

I am building an OData query editor control, so I need to know if these are available.

Thanks!


Solution

  • Yes it does. E.g.:

    GET http://services.odata.org/v4/TripPinServiceRW/People?$filter=(FirstName ne 'Mary' and LastName ne 'White') and UserName ne 'marywhite'
    

    You can try it yourself in a browser.