struct

FalkorDB::Graph

Inherits Struct < Value < Object

Constructors

new(redis : Redis::Commands, key : String, cache : FalkorDB::Cache = Cache.new(redis, key))
Source

Instance methods

cache
Source
constraints
Source
copy(new_key : String)
Source
delete!
Source
execute(command : String, query : String)
Source
execute_read(query : String)
Source
execute_write(query : String)
Source
explain(cypher : String, params)
Source
explain(cypher : String)
Source
indices
Source
list
Source
memory_usage(samples : Int | Nil = nil)
Source
multi

Execute a transaction within the given graph

graph.multi do |txn|
  txn.write_query <<-CYPHER, team_id: 123
    MATCH (
  CYPHER
end
Source
profile(cypher : String, params)
Source
profile(cypher : String)
Source
read_query(cypher : String, params : NamedTuple | Hash, return type : T.class) forall T
Source
read_query(cypher : String, params : NamedTuple | Hash, *, return types : Tuple(*T)) forall T

Query the graph with the given Cypher query, passing in the given params, and returning the given types corresponding to the values in your Cypher RETURN clause.

graph.read_query <<-CYPHER, {team_id: 123}, return: {Person}
  MATCH (team:Team{id: $team_id})
  MATCH (person)-[:MEMBER_OF]->(team)
  RETURN person
CYPHER
Source
read_query(cypher : String)

Query the graph with the given Cypher query.

graph.read_query <<-CYPHER
  MATCH (person:Person)
  RETURN person
CYPHER
Source
read_query(cypher : String, *, return types : T) forall T
Source
read_query(cypher : String, **params)

Query the graph with the given Cypher query, passing in the given params.

graph.read_query <<-CYPHER, team_id: 123
  MATCH (team:Team{id: $team_id})
  MATCH (person)-[membership:MEMBER_OF]->(team)
  RETURN person, membership, team
CYPHER
Source
redis
Source
run_read(cypher : String, params)
Source
run_read(cypher : String)
Source
run_write(cypher : String, params)
Source
run_write(cypher : String)
Source
slowlog
Source
write_query(cypher : String, params : NamedTuple | Hash, return type : T.class) forall T
Source
write_query(cypher : String, params : NamedTuple | Hash, *, return types : Tuple(*T)) forall T

Write data to the graph using the given cypher query, passing in the given params and returning the given types for the values in your query's RETURN clause.

graph.write_query <<-CYPHER, {id: 123, now: Time.utc.to_unix_ms}, return: {Person}
  MATCH (person:Person{id: $id})
  SET person.confirmed_at = $now
  RETURN person
CYPHER
Source
write_query(cypher : String)

Write data to this graph using the given Cypher query.

graph.write_query "MATCH (u:User{active: true}) SET u:ActiveUser, u.active = null"
Source
write_query(cypher : String, *, return types : Tuple(*T)) forall T

Write data to the graph using the given cypher query, passing in the given params and returning the given types for the values in your query's RETURN clause.

graph.write_query <<-CYPHER, {id: 123, now: Time.utc.to_unix_ms}, return: {Person}
  MATCH (person:Person{id: $id})
  SET person.confirmed_at = $now
  RETURN person
CYPHER
Source
write_query(cypher : String, *, return types : T.class) forall T
Source
write_query(cypher : String, **params)

Write data to this graph using the given Cypher query.

graph.write_query "MATCH (u:User{active: $active}) SET u:ActiveUser, u.active = null", active: active
Source