I'm trying to figure out how to reuse/compose (eg. apply a
not
not
) a complex expression that I use in filters.
I have a complex filter expression that looks like this:
read :get_processed_for_visit do filter expr( not is_nil(visit.processing_started_at) and summary_processed_at(is_nil(false)) and summary_processed_at > visit.processing_started_at ) end
read :get_processed_for_visit do filter expr( not is_nil(visit.processing_started_at) and summary_processed_at(is_nil(false)) and summary_processed_at > visit.processing_started_at ) end
and then another one that is:
read :get_unprocessed do filter expr( not (not is_nil(visit.processing_started_at) and summary_processed_at(is_nil(false)) and summary_processed_at > visit.processing_started_at) ) end
read :get_unprocessed do filter expr( not (not is_nil(visit.processing_started_at) and summary_processed_at(is_nil(false)) and summary_processed_at > visit.processing_started_at) ) end
(ie. it's just the
not
not
of the previous one)
Is there a way to extract out the expression so I can do something like:
filter expr(processed)
filter expr(processed)
and
filter expr(not processed)
filter expr(not processed)
I don't think I can use a calculation because it's using
The Elixir backend framework for unparalleled productivity. Declarative tools that let you stop wasting time. Use with Phoenix LiveView or build APIs in minutes for your front-end of choice.