FILTER_FALSE
With
FILTER_FALSE
you remove all false
elements from the provided arguments.
FILTER_FALSE(1, 2, false, 3)
This filters out all the
false
values in the list evaluating to [1, 2, 3]
.p is Person
FILTER_FALSE(
if p.has_email_1 then p.email1 else false end,
if p.has_email_2 then p.email2 else false end,
if p.has_email_3 then p.email3 else false end,
)
Here, we are only returning a certain provided email of a person if an information
has_email
is true
. If that information is false, we then filter the list with FILTER_FALSE
leaving only emails in the list where has_email
was provided and true
.Last modified 1yr ago