June 27, 2024, 12:29 p.m. | Nimra

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

Senior Data Governance Consultant (Remote in US)

@ Resultant | Indianapolis, IN, United States

Senior Data & AI Threat Detection Researcher (Cortex)

@ Palo Alto Networks | Tel Aviv-Yafo, Israel

Senior Systems Engineer - AWS

@ CACI International Inc | 999 REMOTE

Managing Consultant / Consulting Director / Engagement Lead in Cybersecurity Consulting

@ Marsh McLennan | Toronto - Bremner

Specialist , Fraud Investigation and SecOps

@ Concentrix | Bulgaria - Work at Home

Data Engineer, Mid

@ Booz Allen Hamilton | USA, CA, San Diego (1615 Murray Canyon Rd)