EctoNeo4j v0.6.3 Ecto.Adapters.Neo4j.Helper View Source

Useful helpers

Link to this section Summary

Functions

Manage id transformation from and to database. As Neo4j uses a field name id to store its internal id, the Ecto.Schema defined field id is transformed into nodeI to avoid any problem.

Link to this section Functions

Manage id transformation from and to database. As Neo4j uses a field name id to store its internal id, the Ecto.Schema defined field id is transformed into nodeI to avoid any problem.

Examples

iex> to_db_data = %{id: 3, value: "test"}
iex> from_db_data = Ecto.Adapters.Neo4j.Helper.manage_id(to_db_data, :to_db)
%{nodeId: 3, value: "test"}
iex> Ecto.Adapters.Neo4j.Helper.manage_id(from_db_data, :from_db)
%{id: 3, value: "test"}
Link to this function

translate_field(field, arg2) View Source