Filtering for empty field

i have a field Email, i’m trying to filter all the entry with empty field, so i tried with [Email][$notNull] = true but i’m getting a lot of entry that are empty but probably not null and unfortunatelly i can not do a filter [$neq] = “” as i can not have an empty string

i also tried from the strapi admin to test the filter with the ui but i get the same result, and if i try to filter for is null i get only a few entry but doing a is not null i get a lot of entry that in the ui have a - in the table and are empty

what can i do??


This topic has been created from a Discord post (1221836058161844234) to give it more visibility.
It will be on Read-Only mode here.
Join the conversation on Discord

it seams like that when i post or put an empty string from my app strapi does’t consider it as null …

i’ve tried to add a hook for beforeUpdate to check if the string are empty change it to null, but some are in a component(with 5 text field) but in the beforeUpdate hook i can not access those data, i get {
id: 8961,
__pivot: { field: ‘Social’, component_type: ‘’ }

An empty string is indeed not equal to null.
You could search for email null en email equal to an empty string

?filters[$or][0][email][$eq]=&filters[$or][1][email][$null]=true :thinking:

but the not equal to “” it doesn’t work, because i need 2 option find the one that are empty and doing $eq=‘’ seems to work but the $neq=‘’ doesn’t work how can i fix it ?

yes it’s seems to work the error was that is not $neq but just $ne :frowning_with_open_mouth:

Thank <@692004665688064081> for the help