NULL in flux queries

in the filter() function, how do I check if a field is not empty/null?

In particular, I have a time field, is the fill() function with a fake date the only way to do achieve that? This seems to be more of a hack, I was wondering if there is a more elegant solution to perform the check.

@eloparco You can use the exists operator. Here’s a guide for how to do it: Check if a value exists

Your query would look something like:

from(bucket: "example-bucket")
  |> range(start: -1d)
  |> filter(fn: (r) => r._field == "time" and exists r._value )

Thanks, just checked and also not exists works (that was what necessary in my case). Many thanks!