Bolt.Sips v2.0.5 Bolt.Sips.Routing.RoutingTable View Source
representing the routing table elements
There are a couple of ways to get the routing table from the server, for recent Neo4j servers, and with the latest version of Bolt.Sips, you could use this query:
Bolt.Sips.query!(Bolt.Sips.conn, "call dbms.cluster.routing.getRoutingTable({props})", %{props: %{}})
[
%{
"servers" => [
%{"addresses" => ["localhost:7687"], "role" => "WRITE"},
%{"addresses" => ["localhost:7689", "localhost:7688"], "role" => "READ"},
%{
"addresses" => ["localhost:7688", "localhost:7689", "localhost:7687"],
"role" => "ROUTE"
}
],
"ttl" => 300
}
]
Link to this section Summary
Link to this section Types
Link to this type
t()
View Sourcet() :: %Bolt.Sips.Routing.RoutingTable{ roles: %{ required(:read | :write | :route | :direct) => %{ required(String.t()) => non_neg_integer() } }, ttl: non_neg_integer(), updated_at: non_neg_integer() }
Link to this section Functions
Link to this function
parse(map)
View Sourceparse(map()) :: Bolt.Sips.Routing.RoutingTable.t() | {:error, String.t()}