Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
301 changes: 153 additions & 148 deletions modules/ROOT/pages/clauses/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,92 +3,28 @@
[[query-clause]]
= Clauses

[abstract]
--
This section contains information on all the clauses in the Cypher query language.
--

[[reading-clauses]]
== Reading clauses

[[administration-clauses]]
== Administration clauses

These comprise clauses used to manage databases, schema and security; further details can found in xref::administration/databases.adoc[Database management] and xref::administration/access-control/index.adoc[Access control].

[options="header"]
|===
| Clause | Description

m| xref::administration/databases.adoc[CREATE \| DROP \| START \| STOP DATABASE]
| Create, drop, start or stop a database.

m| xref::indexes-for-search-performance.adoc#indexes-syntax[CREATE \| DROP INDEX]
| Create or drop an index on all nodes with a particular label and property.

m| xref::constraints/syntax.adoc[CREATE \| DROP CONSTRAINT]
| Create or drop a constraint pertaining to either a node label or relationship type, and a property.

| xref::administration/access-control/index.adoc[Access control]
| Manage users, roles, and privileges for database, graph and sub-graph access control.

|===

[[configuration-commands]]
== Configuration Commands

[options="header"]
|===
| Clause | Description

m| xref:clauses/listing-settings.adoc[SHOW SETTINGS]
| List configuration settings.

|===

[[importing-clauses]]
== Importing data

[options="header"]
|===
| Clause | Description

m| xref::clauses/load-csv.adoc[LOAD CSV]
| Use when importing data from CSV files.

m| xref::clauses/call-subquery.adoc#subquery-call-in-transactions[CALL { ... } IN TRANSACTIONS]
| This clause may be used to prevent an out-of-memory error from occurring when importing large amounts of data using `LOAD CSV`.

|===

These comprise clauses that read data from the database.

[[listing-functions-and-procedures]]
== Listing functions and procedures
The flow of data within a Cypher query is an unordered sequence of maps with key-value pairs -- a set of possible bindings between the variables in the query and values derived from the database.
This set is refined and augmented by subsequent parts of the query.

[options="header"]
|===
| Clause | Description

m| xref::clauses/listing-functions.adoc[SHOW FUNCTIONS]
| List the available functions.

m| xref::clauses/listing-procedures.adoc[SHOW PROCEDURES]
| List the available procedures.

|===


[[multiple-graphs-clauses]]
== Multiple graphs

[options="header"]
|===
| Clause | Description
m| xref::clauses/match.adoc[MATCH]
| Specify the patterns to search for in the database.

m| xref::clauses/use.adoc[USE]
| Determines which graph a query, or query part, is executed against. label:fabric[]
m| xref::clauses/optional-match.adoc[OPTIONAL MATCH]
| Specify the patterns to search for in the database while using `nulls` for missing parts of the pattern.

|===


[[projecting-clauses]]
== Projecting clauses

Expand All @@ -110,53 +46,6 @@ m| xref::clauses/unwind.adoc[UNWIND ... [AS]]

|===


[[reading-clauses]]
== Reading clauses

These comprise clauses that read data from the database.

The flow of data within a Cypher query is an unordered sequence of maps with key-value pairs -- a set of possible bindings between the variables in the query and values derived from the database.
This set is refined and augmented by subsequent parts of the query.

[options="header"]
|===
| Clause | Description

m| xref::clauses/match.adoc[MATCH]
| Specify the patterns to search for in the database.

m| xref::clauses/optional-match.adoc[OPTIONAL MATCH]
| Specify the patterns to search for in the database while using `nulls` for missing parts of the pattern.

|===


[[reading-hints]]
== Reading hints

These comprise clauses used to specify planner hints when tuning a query.
More details regarding the usage of these -- and query tuning in general -- can be found in xref::query-tuning/using.adoc[Planner hints and the USING keyword].

[options="header"]
|===
| Hint | Description

m| xref::query-tuning/using.adoc#query-using-index-hint[USING INDEX]
| Index hints are used to specify which index, if any, the planner should use as a starting point.

m| xref::query-tuning/using.adoc#query-using-index-hint[USING INDEX SEEK]
| Index seek hint instructs the planner to use an index seek for this clause.

m| xref::query-tuning/using.adoc#query-using-scan-hint[USING SCAN]
| Scan hints are used to force the planner to do a label scan (followed by a filtering operation) instead of using an index.

m| xref::query-tuning/using.adoc#query-using-join-hint[USING JOIN]
| Join hints are used to enforce a join operation at specified points.

|===


[[reading-sub-clauses]]
== Reading sub-clauses

Expand All @@ -180,6 +69,38 @@ m| xref::clauses/limit.adoc[LIMIT]

|===

[[writing-clauses]]
== Writing clauses

These comprise clauses that write the data to the database.

[options="header"]
|===
| Clause | Description

m| xref::clauses/create.adoc[CREATE]
| Create nodes and relationships.

m| xref::clauses/delete.adoc[DELETE]
a|
Delete nodes, relationships or paths.
Any node to be deleted must also have all associated relationships explicitly deleted.

m| xref::clauses/delete.adoc[DETACH DELETE]
a|
Delete a node or set of nodes.
All associated relationships will automatically be deleted.

m| xref::clauses/set.adoc[SET]
| Update labels on nodes and properties on nodes and relationships.

m| xref::clauses/remove.adoc[REMOVE]
| Remove properties and labels from nodes and relationships.

m| xref::clauses/foreach.adoc[FOREACH]
| Update data within a list, whether components of a path, or the result of aggregation.

|===

[[reading-writing-clauses]]
== Reading/Writing clauses
Expand All @@ -204,6 +125,22 @@ m| xref::clauses/call.adoc[CALL ... [YIELD ... ]]

|===

[[subquery-clauses]]
== Subquery clauses

[options="header"]
|===
|Clause |Description

m| xref::clauses/call-subquery.adoc[CALL { ... }]
| Evaluates a subquery, typically used for post-union processing or aggregations.

m| xref::clauses/call-subquery.adoc#subquery-call-in-transactions[CALL { ... } IN TRANSACTIONS]
a|
Evaluates a subquery in separate transactions.
Typically used when modifying or importing large amounts of data.

|===

[[set-operations-clauses]]
== Set operations
Expand All @@ -224,24 +161,58 @@ Duplicates are retained.

|===

[[multiple-graphs-clauses]]
== Multiple graphs

[[subquery-clauses]]
== Subquery clauses
[options="header"]
|===
| Clause | Description

m| xref::clauses/use.adoc[USE]
| Determines which graph a query, or query part, is executed against. label:fabric[]

|===

[[importing-clauses]]
== Importing data

[options="header"]
|===
|Clause |Description
| Clause | Description

m| xref::clauses/call-subquery.adoc[CALL { ... }]
| Evaluates a subquery, typically used for post-union processing or aggregations.
m| xref::clauses/load-csv.adoc[LOAD CSV]
| Use when importing data from CSV files.

m| xref::clauses/call-subquery.adoc#subquery-call-in-transactions[CALL { ... } IN TRANSACTIONS]
a|
Evaluates a subquery in separate transactions.
Typically used when modifying or importing large amounts of data.
| This clause may be used to prevent an out-of-memory error from occurring when importing large amounts of data using `LOAD CSV`.

|===

[[listing-functions-and-procedures]]
== Listing functions and procedures
[options="header"]
|===
| Clause | Description

m| xref::clauses/listing-functions.adoc[SHOW FUNCTIONS]
| List the available functions.

m| xref::clauses/listing-procedures.adoc[SHOW PROCEDURES]
| List the available procedures.

|===

[[configuration-commands]]
== Configuration Commands

[options="header"]
|===
| Clause | Description

m| xref:clauses/listing-settings.adoc[SHOW SETTINGS]
| List configuration settings.

|===

[[transaction-commands]]
== Transaction Commands
Expand All @@ -258,36 +229,70 @@ m| xref:clauses/transaction-clauses.adoc#query-terminate-transactions[TERMINATE

|===

[[writing-clauses]]
== Writing clauses

These comprise clauses that write the data to the database.
[[reading-hints]]
== Reading hints

These comprise clauses used to specify planner hints when tuning a query.
More details regarding the usage of these -- and query tuning in general -- can be found in xref::query-tuning/using.adoc[Planner hints and the USING keyword].

[options="header"]
|===
| Clause | Description
| Hint | Description

m| xref::clauses/create.adoc[CREATE]
| Create nodes and relationships.
m| xref::query-tuning/using.adoc#query-using-index-hint[USING INDEX]
| Index hints are used to specify which index, if any, the planner should use as a starting point.

m| xref::clauses/delete.adoc[DELETE]
a|
Delete nodes, relationships or paths.
Any node to be deleted must also have all associated relationships explicitly deleted.
m| xref::query-tuning/using.adoc#query-using-index-hint[USING INDEX SEEK]
| Index seek hint instructs the planner to use an index seek for this clause.

m| xref::clauses/delete.adoc[DETACH DELETE]
a|
Delete a node or set of nodes.
All associated relationships will automatically be deleted.
m| xref::query-tuning/using.adoc#query-using-scan-hint[USING SCAN]
| Scan hints are used to force the planner to do a label scan (followed by a filtering operation) instead of using an index.

m| xref::clauses/set.adoc[SET]
| Update labels on nodes and properties on nodes and relationships.
m| xref::query-tuning/using.adoc#query-using-join-hint[USING JOIN]
| Join hints are used to enforce a join operation at specified points.

m| xref::clauses/remove.adoc[REMOVE]
| Remove properties and labels from nodes and relationships.
|===

m| xref::clauses/foreach.adoc[FOREACH]
| Update data within a list, whether components of a path, or the result of aggregation.
[[index-and-constraint-clauses]]
== Index and constraint clauses

These comprise clauses to create, show, and drop indexes and constraints.

[options="header"]
|===
| Clause | Description

m| xref::indexes-for-search-performance.adoc#indexes-syntax[CREATE \| SHOW \| DROP INDEX]
| Create, show or drop an index.

m| xref::constraints/syntax.adoc[CREATE \| SHOW \| DROP CONSTRAINT]
| Create, show or drop a constraint.
|===

[[administration-clauses]]
== Administration clauses

These comprise clauses used to manage databases, aliases, servers, and role-based access control.
More information about these topics can be found in the xref::administration/index.adoc[Administration] chapter.

[options="header"]
|===
| Clause | Description

m| xref::administration/databases.adoc[CREATE \| SHOW \| START \| ALTER \| STOP \| DROP [COMPOSITE\] DATABASE]
| Create, show, start, alter, drop or stop a standard or composite database.

m| xref::administration/aliases.adoc[CREATE \| SHOW \| ALTER \| DROP ALIAS]
| Create, show, alter or drop a local or remote database alias.

m| xref::administration/servers.adoc[ENABLE \| SHOW \| RENAME \| ALTER \| DROP SERVER]
| Enable, show, rename, alter or drop a server.

m| xref::administration/servers.adoc#server-management-reallocate[REALLOCATE \| DEALLOCATE DATABASES]
| Reallocates databases in, or deallocates databases from, a server.

| xref::administration/access-control/index.adoc[Access control]
| Manage users, roles, and privileges for database, graph and sub-graph access control.

|===