sen

sen

Hi all, what should input to field(:test, :map)?

field(:test, {:array, :map}) => name: [%{“name1” => “test”, “name2” => “test”}]

field(:test, :map) => ???

Showing Posts 1 to 4

NobbZ

NobbZ

Can you please elaborate your question? Where does the field/2 function come from? What is meant by =>?

sen

sen OP

Hi, Thanks for reply.
just a schema table, i want to know what value should be input in field(:test1, :map).

schema “tablename” do
field(:id, :integer)
field(:name, :string)
field(:test1, :map)
field(:test2, {:array, :map})
end

because i know field(:test2, {:array, :map}) input like this
test: [%{“name1” => “test”, “name2” => “test”}] ,
but i dun know what value should be input in field(:test1, :map).

NobbZ

NobbZ

So this question is related to ecto?

From its documentation it seems as if :map simply maps over to elixirs map type, eg: %{} or %{"foo" => 2}.

sen

sen OP

Yes, correct . Thanks for answer.

— All posts loaded —

Where Next? Top

Trending in Chat/Questions Top

krisleech
Hey folks, I’ve been using Elixir for over a couple of years (phx, ecto, broadway, oban). For this kind of work you do not tend, in my e...
New
mhindujadheerajsudan
Hi, I’m Dheeraj Sudan from the UK. I’m a software developer and also run a business with my wife Meenu Hinduja. I’m interested in getting...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews