Query

how do i translate this code for example Helpdesk.Support.Ticket|> Ash.Query.filter(contains(subject, "2")) into the resource's read action. Basically as part of my read action I want to filter with something similar to SQL like. i can do it on iex. but not sure how to intergrate into read action for my api.? i want to know how to use the contains(subject, "2") inside the read action?
1 Reply
\ ឵឵឵
\ ឵឵឵2y ago
actions do
read :read do
filter expr(contains(subject, "2"))
end
end
actions do
read :read do
filter expr(contains(subject, "2"))
end
end
They translate quite directly—Ash.Query.filter takes its contents as an expr automatically.

Did you find this page helpful?