# `NebulaGraphEx.Record`
[🔗](https://github.com/VChain/nebula_graph_ex/blob/v0.1.8/lib/nebula_graph_ex/record.ex#L1)

A single row in a `NebulaGraphEx.ResultSet`.

Values are decoded Elixir terms — not raw Thrift tuples. Use `get/2` to
access a column by name, or `get!/2` to raise if the column is absent.

## Example

    {:ok, rs} = NebulaGraphEx.Graph.query(conn, "MATCH (v:Player) RETURN v.name, v.age")

    records = NebulaGraphEx.ResultSet.rows(rs)
    Enum.map(records, fn record ->
      name = NebulaGraphEx.Record.get!(record, "v.name")
      age  = NebulaGraphEx.Record.get(record, "v.age")
      %{name: name, age: age}
    end)

# `t`

```elixir
@type t() :: %NebulaGraphEx.Record{columns: [String.t()], values: [term()]}
```

# `fetch`

```elixir
@spec fetch(t(), String.t()) :: {:ok, term()} | {:error, :not_found}
```

Returns `{:ok, value}` if the column exists, `{:error, :not_found}` otherwise.

# `get`

```elixir
@spec get(t(), String.t()) :: term()
```

Returns the decoded value for the given column name, or `nil` if the column
does not exist in this record.

# `get!`

```elixir
@spec get!(t(), String.t()) :: term()
```

Returns the decoded value for `name`, raising `KeyError` if the column is
not present.

# `to_map`

```elixir
@spec to_map(t()) :: %{required(String.t()) =&gt; term()}
```

Converts the record to a plain map keyed by column name.

## Example

    NebulaGraphEx.Record.to_map(record)
    #=> %{"v.name" => "Tim Duncan", "v.age" => 42}

---

*Consult [api-reference.md](api-reference.md) for complete listing*
