How to do an Odata query filter != boolean

I would like to do an Odata query where I filter on a Boolean column like this:

Example:

IsVisible != true (or IsVisible != false).

Now I know that in Odata this would be "IsVisible ne 'true'". If IsVisible happens to be null, then this "ne true" does not return null values of IsVisible (which is what I want). Instead it is just returning values for IsVisible == true.

I know that I can get the records that I want by doing something like this:

IsVisible == null (IsVisible eq 'null').

The question is this:

How can I make Odata return IsVisible == 'true' AND IsVisible == 'null' when I filter by IsVisible != false (IsVisible ne 'false')?

Answers


Looking at the tag you assigned to the question, I would point out that this is actually not boolean logic, but three-valued logic. Implementations of such models must necessarily make arbitrary choices regarding their constructs, and in the case of OData, it seems that "something that isn't false must be true".

I suppose this is in part because more people would be confused otherwise, and in part because most other implementations work that way too.

As far as I know, there is no shortcut for your use-case (you must check both conditions explicitly).


Need Your Help

disable TYPO3 link parsing in html block

php jquery html twitter-bootstrap typo3

In TYPO3 I used html blocks which contains a nav of hash-tags

Query to insert or update n column from Parent table into 2 column of history table

mysql sql database triggers audit-trail

i need PHP-MYSQL Query ( code ) for History table: I know what i have to do and how - but not getting how to write mysql query for it and same for listing in php page . below is what i have think and