Get Values Back
Explore how the returning option in Ecto's Repo module allows you to retrieve specific field values, such as auto-assigned IDs, after database insert or update operations. Learn how Ecto returns results and how to work with returned maps to handle data efficiently in your Elixir applications.
We'll cover the following...
We'll cover the following...
Return value of queries
In each of the examples we’ve seen so far, Ecto returns a tuple. This is the standard return value for the *_all functions.
- The first item in the tuple is the number of records affected by the operation.
- The second