Mysql json data not encoded by ecto

I am using the :map in migration and in schema field :filed_name, {:array, :integer}
But when i query the table I am getting the below error
cannot load “[1,3,23]” as type {:array, :integer} for field :filed_name

is there anything i am doing wrong?

Could you please provide the full stack trace? I’m not familiar with json on the database, but you might want to check that the column was created with the right data type, and use the same type between migration and schema

Wouldn’t your migration type be {:array, :integer}.
As shown here

Ecto type Elixir type Literal syntax in query
{:array, inner_type} list [value, value, value, …]

If the DB is Postgres then it should work. I don’t think MySQL support list.

As you can see here
https://hexdocs.pm/ecto_sql/Ecto.Adapters.MyXQL.html#module-json-support
to use json in MySQL you need to define migration
add :field, :map/:text

and in the schema I have defined the field like this
field :filed_name, {:array, :integer}

the data that I want to insert is [1, 2 ,3]
and according to the docs
the adapter will automatically encode/decode the value from JSON.
this should be the behaviour. json from db should be converted to elixir type.