🔍 MATCH: Pattern Matching
()
→ Node[]
→ Edge-
→ Undirected edge- Labels:
:Label
- Properties:
{key="value", age=30}
🛠 CREATE: Add Nodes & Edges
- Labels required
- No
RETURN
clause - Use commas to create multiple items at once
🎯 Property Match Operators
-
=
or:
→ exact match -
~=
→ string approximation (prefix-based, case-insensitive)
📦 Data Types
Type | Example |
---|---|
String | "hello" or 'hello' |
Integer | age=30 |
Unsigned | age=30u |
Boolean | flag=true |
Double | score=3.14 |
✨ RETURN Clause
RETURN *
→ expands to all variables- Select fields with
RETURN n.prop, m.prop
📌 Node ID Injection
- Use
@
orAT
to reference internal IDs
🔬 Metaqueries (CALL
)
Query | Description |
---|---|
CALL PROPERTIES() | All node/edge property keys & types |
CALL LABELS() | All node labels |
CALL EDGETYPES() | All edge types |
CALL LABELSETS() | Combinations of labels |
🔧 Engine Commands
Command | Description |
---|---|
CREATE GRAPH <name> | Create a new named graph |
LOAD GRAPH <name> | Load an existing graph |
LIST GRAPH | List all available graphs |
HISTORY | Show commit history (versioning) |
CHANGE NEW | Create a new isolated change |
CHANGE SUBMIT | Merge current change into main |
CHANGE DELETE | Delete current change |
CHANGE LIST | List active uncommitted changes |
🧠 Useful Patterns
📘 Best Practices
- Use
CALL PROPERTIES()
to discover property keys - Use
RETURN *
while prototyping - Use
@
for precise node editing or merging - Avoid regex — use
~=
for faster fuzzy search - All edges are currently undirected