Keyword list filters on json fields

I want to understand more about keyword list filters, specifically how to filter on fragments Suppose I have a user resource with one-to-many relationship with posts. I want to count posts for each user by filtering on the post's metadata column. Something like
Ash.Query.Aggregate.new!(User, name, :count,
path: [:posts],
query: [filter: [
"meta->>'published'": "yes",
]]
)
Ash.Query.Aggregate.new!(User, name, :count,
path: [:posts],
query: [filter: [
"meta->>'published'": "yes",
]]
)
But this is not correct format for keyword list filters. Is there a way to do this?
Solution:
Figured it out. If I define a published calculation, I can use it in the keyword list, like filter: [published: "yes"]
Jump to solution
1 Reply
Solution
fs4k
fs4k2w ago
Figured it out. If I define a published calculation, I can use it in the keyword list, like filter: [published: "yes"]

Did you find this page helpful?