CQL Query Language -- Neo4j
This document is summarized based on the introdcution of Neo4j in W3Cschool
Neo4j CQL common order/clause:
-
###CREATE
1.1 Used to create non-attar node; create a non-statistic node
Grammar: CREATE (<node-name:)
: node name to create
: node tag name
1.2 Used to create attractive node
Grammar: CREATE(
:
{
:
……
:
}
)
Attr is a key-value pair.
1.3 Used to create one label for node
Used to create multiple labels for node
Grammar: CREATE (::……:)
Used to create one label for relation
Grammar: CREATE(:)-[(:)]—>(:)
-
MATCH
Used to achieve data related to nodes and attrs;
Used to achieve data related to nodes, relations and attrs.
Grammar: MATCH(
:
)
-
RETURN
Used to retrieve some attrs of node;
Used to retrieve all attrs of node;
Used to retrieve some attrs of node and relations;
Used to retrieve all attrs of node and relations
Grammar: RETURN
.,
…….
.
Concat ‘Match’ and ‘Return’ to retrieve
E.G. MATCH(dept: Dept)
RETURN dept.deptno, dept.dname
-
WHERE
-
DELETE
-
REMOVE
-
ORDER BY
-
SET
RELATION
Unilateralism
Bilateralism