One request often made when filtering a collection by values is the case of the null value. Sadly this is a very painful case because the value retrieved on the server side is always a string and that it's no possible with the current implementation to pass an empty value.
Unfortunately I didn't find much on the subject aside from this post which suggest a "hacky" solution: defining custom values.
I tested a little bit with a StrongLoop application and the following query ?filter[where][property]=null works whatever the type of the value is.
The only problem is for string values. Indeed it becomes impossible to search for a string with the value "null".
@dunglas, @sroze what are your though on this case? Should we do as StrongLoop which has the drawback of disabling the search filter for string properties of value "null"?
One request often made when filtering a collection by values is the case of the
nullvalue. Sadly this is a very painful case because the value retrieved on the server side is always a string and that it's no possible with the current implementation to pass an empty value.Unfortunately I didn't find much on the subject aside from this post which suggest a "hacky" solution: defining custom values.
I tested a little bit with a StrongLoop application and the following query
?filter[where][property]=nullworks whatever the type of the value is.The only problem is for string values. Indeed it becomes impossible to search for a string with the value
"null".@dunglas, @sroze what are your though on this case? Should we do as StrongLoop which has the drawback of disabling the search filter for string properties of value
"null"?