Ecto Query in iex does not show all returned data. Shows [...]

Hey! When querying the database, I am wanting to have all my data shown when returned, and right now I can only see some of it. It it gives me [...] instead
This is my database search tool:

def database_search_tool(fruit) do
for x ← from(s in StandardHotel, select: s.fruits) |> Repo.all(timeout: :infinity) do
x |> Enum.filter(&String.contains?(&1, fruit))
end
end

And this is an example of what I might get back. I don’t want [...] I want to see what’s in the database.

iex(13)> Amenities.database_search_tool(“Apple”)
[
[“Apple, Banana, Orange”, “Apples”,
“Apples are the best”, “I ate an Apple for breakfast”, “Grateful for Apples”,
…],
[…],

]

Thanks! :sunny:

1 Like

This is an inspecting behaviour in Elixir. The result returned by interactive Elixir shell (short iex) is an inspected result. See Kernel.inspect/2 and IO.inspect/2 for more information.

2 Likes

Hi, check :limit option:
https://hexdocs.pm/elixir/Inspect.Opts.html

1 Like

Linking directly to Inspect.Opts was not enough clear for me. I have added links to inspect functions instead. Those links to Inspect.Opts module as well as give many examples for opts argument, so author can investigate not only the struct itself, but also a way to inspect everything by hand.

Also IEx.configure/1 is worth to mention in case we want to change a default shell behaviour.