Calculation returning array of strings

I have a calculation that returns an array of strings.
calculations do
calculate :name_variations, {:array, :string}, fn _, _ ->
["hello", "world"]
end
end
calculations do
calculate :name_variations, {:array, :string}, fn _, _ ->
["hello", "world"]
end
end
But when I load this calculation, I get back only 2 results from the query. The first has "hello" and the other "world". Why don't I get all query results instead of the first 2 with each of them having the full list?
Solution:
```elixir calculations do calculate :namevariations, {:array, :string}, fn records, -> Enum.map(records, fn _ -> ["hello", "world"] end) end...
Jump to solution
3 Replies
ZachDaniel
ZachDaniel3mo ago
calculations take lists of records and return lists of records
Solution
ZachDaniel
ZachDaniel3mo ago
calculations do
calculate :name_variations, {:array, :string}, fn records, _ ->
Enum.map(records, fn _ -> ["hello", "world"] end)
end
end
calculations do
calculate :name_variations, {:array, :string}, fn records, _ ->
Enum.map(records, fn _ -> ["hello", "world"] end)
end
end
Sienhopist
SienhopistOP3mo ago
Thanks

Did you find this page helpful?