AshNeo4j.Neo4jHelper (AshNeo4j v0.1.0)
View SourceAshNeo4j Datalayer Neo4j Helper
Summary
Functions
Creates a neo4j node with label and properties
Delete all neo4j nodes and relationships
Creates a neo4j node with label and properties
Tests if two nodes are related with a relationship type ## Examples
Reads nodes from Neo4j, given label and optionally properties
Relates two nodes with a relationship type ## Examples
Functions
Creates a neo4j node with label and properties
Examples
iex> {result, _} = AshNeo4j.Neo4jHelper.create_node(:Actor, %{name: "Bill Nighy"})
iex> result
:ok
Delete all neo4j nodes and relationships
Examples
iex> {result, _} = AshNeo4j.Neo4jHelper.delete_all()
iex> result
:ok
Creates a neo4j node with label and properties
Examples
iex> {result, _} = AshNeo4j.Neo4jHelper.merge_node(:Actor, %{name: "Bill Nighy", born: 1949})
iex> result
:ok
Tests if two nodes are related with a relationship type ## Examples
iex> AshNeo4j.Neo4jHelper.create_node(:Actor, %{name: "Bill Nighy", born: 1949})
iex> AshNeo4j.Neo4jHelper.create_node(:Movie, %{title: "Love Actually"})
iex> AshNeo4j.Neo4jHelper.relate_nodes(:Actor, %{name: "Bill Nighy"}, :Movie, %{title: "Love Actually"}, :ACTED_IN)
iex> AshNeo4j.Neo4jHelper.nodes_relate_how?(:Actor, %{name: "Bill Nighy"}, :Movie, %{title: "Love Actually"}, :ACTED_IN)
true
Reads nodes from Neo4j, given label and optionally properties
Examples
iex> AshNeo4j.Neo4jHelper.create_node(:Actor, %{name: "Bill Nighy", born: 1949})
iex> {:ok, %{records: records}} = AshNeo4j.Neo4jHelper.read_nodes(:Actor, %{name: "Bill Nighy"})
iex> length(records)
1
Relates two nodes with a relationship type ## Examples
iex> AshNeo4j.Neo4jHelper.create_node(:Actor, %{name: "Bill Nighy", born: 1949})
iex> AshNeo4j.Neo4jHelper.create_node(:Movie, %{title: "Love Actually"})
iex> {result, _} = AshNeo4j.Neo4jHelper.relate_nodes(:Actor, %{name: "Bill Nighy"}, :Movie, %{title: "Love Actually"}, :ACTED_IN)
iex> result
:ok