all InfoSec news
Mastering Cypher Queries in Apache AGE
DEV Community dev.to
Basic Cypher Queries
Creating Nodes
Nodes are the fundamental units in a graph database. Here’s how to create nodes using Cypher:
-- Create a person node with properties
CREATE (n:Person {name: 'Alice', age: 30});
CREATE (n:Person {name: 'Bob', age: 25});
Creating Relationships
Relationships connect nodes and provide context to the data. Here’s how to create a relationship between two nodes:
MATCH (a:Person {name: 'Alice'}), (b:Person {name: 'Bob'})
CREATE (a)-[:FRIEND]->(b);
Retrieving Nodes
To retrieve nodes from the graph, use the MATCH …
age alice apache apacheage basic connect context cypher data database graph graph database name node nodes postgres queries relationships using