Hi,
I am currently having problems trying to update a nested map in a Schema since it doesn’t allow for Access behaviour I can’t just Kernel.put_in
etc…
My Schema is as follows:
> %PhoenixApi.Schema.Test{
> __meta__: #Ecto.Schema.Metadata<:loaded, "test_table">,
> id: 1,
> delete: false,
> person: %{
> "city" => %{"55" => "London"},
> "name" => "john cena"
> "address" => "55 Test Drive"
> }
> }
I use get_test(id)
to retrieve this information, but I would like to change the persons name and city before updating it/sending it back into my table.
This person is stored as a :map
in the schema.
I know update needs a changeset to work, it’s how to make the changes in the changeset for Ecto.update
and updating nested maps in structs is confusing me, sorry.
Thank you for reading.