I want to store jsonb both array and map. structure is very dynamic and its coming from Government sites and if we update front-end its a lot of work to convert/adjust to maps only. Is there a way/workaround that I can use, store and retrieve both json/map and array types which are valid for jsonb postgres type. I have tried to use source and copy to array type sourced field before calling cast pipeline if I get array in params(condition: Map.has_key?(params, "value") && is_list(value)
). I am successfully able to save data but when retrieving from db I am getting cast error
field(:value, :map)
field(:value_array, {:array, :integer}, source: :value)
Note: Ecto version > 3 and postgres 10