FalkorDB::Relationship
Represents a relationship in your graph
result = graph.read_query(<<-CYPHER)
MATCH (:User)-[membership:MEMBER_OF]->(:Team)
RETURN membership
CYPHER
result.each do |(membership)|
membership = membership.as(FalkorDB::Relationship)
# ...
end
Constructors
Class methods
Instance methods
dest_node
The node that this relationship points to, for example with
(person)-[membership]->(team), it will be the node id of team.
WARNING: This will not match an id property of the destination node.
id
The identifier of the relationship.
NOTE: If this relationship has an id property, this is not that.
WARNING: Do not try to query against this. FalkorDB provides no
guarantees that this relationship will be at the same offset it was at
the last time you queried it.
properties
The hash of properties for this relationship.
result = graph.write_query <<-CYPHER, now: Time.utc.to_unix_ms
CREATE (person)-[membership{since: $now}]->(team)
RETURN membership
CYPHER
result.first.properties # => {"since" => 2022-05-15T05:48:23 UTC}
src_node
The node that this relationship originates from, for example with
(person)-[membership]->(team), it will be the node id of person.
WARNING: This will not match an id property of the source node.