Operators

This page provides an overview of the available operators in Cypher®. An operator is a specialized execution module that is responsible for some type of transformation to the data in a query execution plan before passing it on to the next operator, until the desired graph pattern has been matched.

For information about how to understand execution plans (and the role operators play in them), see Understanding execution plans.

For more information about each operator, see Operators in detail.

Summary of operators

This table comprises all the execution plan operators ordered lexicographically.

  • Leaf operators, in most cases, locate the starting nodes and relationships required in order to execute the query.

  • Updating operators are used in queries that update the graph.

  • Eager operators accumulate all their rows before piping them to the next operator.

Name Description Leaf? Updating? Considerations

Reads all nodes from the node store.

Yes

Tests for the absence of a pattern.

Performs a nested loop. Tests for the absence of a pattern predicate.

Performs a nested loop. Yields rows from both the left-hand and right-hand side operators.

Indicates the variable to be used as an argument to the right-hand side of an Apply operator.

Yes

Used to ensure row-by-row semantics. Restricts the Cypher runtime to not batch operations in larger chunks.

Yes

Ensures that no node property uniqueness constraints are violated.

Ensures that no relationship property uniqueness constraints are violated.

Introduced in 5.8

Used to ensure that no property uniqueness constraints are violated.

Yes

Reads node or relationship properties and caches them.

Produces a cartesian product of the inputs from the left-hand and right-hand operators.

Creates nodes and relationships.

Yes

Creates an index for either nodes or relationships.

Yes

Creates a constraint for either nodes or relationships.

Yes

Deletes a node or relationship.

Yes

Deletes a node and its relationships.

Yes

Fetches all relationships and their start and end nodes in the database.

Yes

Reads one or more relationships by element id (specified via the function elementId()) from the relationship store and produces the relationship as well as the source and target node of the relationship.

Yes

Reads one or more relationships by id (specified via the function Id()) from the relationship store, and produces the relationship as well as the source and target node of the relationship.

Yes

Examines all values stored in an index, searching for entries containing a specific STRING; for example, in queries including CONTAINS.

Yes

Examines all values stored in an index, searching for entries ending in a specific STRING; for example, in queries containing ENDS WITH.

Yes

Examines all values stored in an index, returning all relationships and their start and end nodes with a particular relationship type and a specified property.

Yes

Finds relationships and their start and end nodes using an index seek.

Yes

Finds relationships and their start and end nodes using an index seek where the value of the property matches a given prefix STRING.

Yes

Fetches all relationships and their start and end nodes with a specific type from the relationship type index.

Yes

Fetches all relationships and their start and end nodes with at least one of the provided types from the relationship type index.

Drops duplicate rows from the incoming stream of rows.

Eager

Checks if a constraint already exists, if it does then it stops the execution, if not it continues.

Yes

Checks if an index already exists, if it does then it stops the execution, if not it continues.

Yes

Drops a constraint using its name.

Yes

Yes

Drops an index using its name.

Yes

Yes

For isolation purposes, Eager ensures that operations affecting subsequent operations are executed fully for the whole dataset before continuing execution.

Eager

Evaluates a grouping expression.

Eager

Eagerly loads all incoming data and discards it.

Eager

Returns a single row with no columns.

Yes

The ExhaustiveLimit operator is similar to the Limitoperator, but always exhausts the input. Used when combining LIMIT and updates.

Traverses incoming or outgoing relationships from a given node.

Finds all relationships between two nodes.

Filters each row coming from the child operator, only passing through rows that evaluate the predicates to true.

Performs a nested loop. Yields rows from the left-hand operator and discards rows from the right-hand operator.

Fetches all nodes that have all of the provided labels from the node label index.

Yes

Introduced in 5.5

Performs a nested loop. Tests for the absence of a pattern predicate in queries containing multiple pattern predicates.

Performs a nested loop. Tests for the absence of a pattern predicate that is combined with other predicates.

Performs a nested loop. Tests for the presence of a pattern predicate that is combined with other predicates.

Performs a nested loop. Tests for the presence of a pattern predicate in queries containing multiple pattern predicates.

Returns the first n rows from the incoming input.

Loads data from a CSV source into the query.

Yes

Similar to the Merge operator but will lock the start and end node when creating a relationship if necessary.

The Merge operator will either read or create nodes and/or relationships.

Finds nodes using multiple index seeks.

Yes

Reads one or more nodes by id from the node store, specified via the function elementId().

Yes

Introduced in 5.3

Reads one or more nodes by id from the node store, specified via the function id().

Yes

Fetches all nodes with a specific label from the node label index.

Yes

Uses the count store to answer questions about node counts.

Yes

Executes a hash join on node ID.

Eager

Examines all values stored in an index, searching for entries containing a specific STRING.

Yes

Examines all values stored in an index, searching for entries ending in a specific STRING.

Yes

Examines all values stored in an index, returning all nodes with a particular label with a specified property.

Yes

Finds nodes using an index seek.

Yes

Finds nodes using an index seek where the value of the property matches the given prefix STRING.

Yes

Executes a left outer hash join.

Eager

Executes a right outer hash join.

Eager

Finds nodes using an index seek within a unique index.

Yes

Finds nodes using an index seek within a unique index where the value of the property matches the given prefix STRING.

Yes

responsible for cleaning up the state produced by Repeat(Trail). It is only planned directly after Repeat(Trail).

Introduced in 5.9

Yields a single row with all columns set to null if no data is returned by its source.

Traverses relationships from a given node, producing a single row with the relationship and end node set to null if the predicates are not fulfilled.

Traverses all relationships between two nodes, producing a single row with the relationship and end node set to null if no matching relationships are found (the start node is the node with the smallest degree).

Similar to the EagerAggregation operator but relies on the ordering of incoming rows. It is not eager.

Similar to the DISTINCT operator but relies on the ordering of incoming rows.

Sorts a row by multiple columns if there is already an ordering.

Returns the first n rows sorted by multiple columns if there is already an ordering.

Used by the parallel runtime to read all nodes from the node store.

Yes

Introduced in 5.17

Used by the parallel runtime to fetch all relationships and their start and end nodes from the database.

Yes

Introduced in 5.17

Used by the parallel runtime to examine all values stored in an index. It returns all relationships with a particular type and a specified property, along with their start and end nodes.

Yes

Introduced in 5.17

Finds relationships and their start and end nodes using a parallel index seek.

Yes

Introduced in 5.17

Finds relationships using a parallel index seek where the value of the of the specified relationship type property is within a given range. It also finds the start and end nodes of those relationships.

Yes

Introduced in 5.17

Fetches all relationships with a specific type from the relationship type index using a parallel scan. It also fetches the start and end nodes of those relationships.

Yes

Introduced in 5.17

Fetches all relationships with at least one of the provided types from the relationship type index using a parallel scan. It also fetches the start and end nodes of those relationships.

Introduced in 5.17

Used by the parallel runtime to fetch all nodes with a specific label from the node label index.

Yes

Introduced in 5.17

Used by the parallel runtime to examine all values stored in an index, returning all nodes with a particular label and a specified property.

Yes

Introduced in 5.17

Used by the parallel runtime to find nodes using an index seek.

Yes

Introduced in 5.17

Finds nodes using a parallel index seek where the value of the specified property is within a given range.

Yes

Introduced in 5.17

Used by the parallel runtime to fetch all nodes that have all of the first set of provided labels and none of the second provided set of labels from the node label index.

Yes

Introduced in 5.21

Used by the parallel runtime to fetch all relationships and their start and end nodes from the database.

Yes

Introduced in 5.17

Used by the parallel runtime to examine all values stored in an index, returning all relationships with a particular relationship type and a specified property. It also returns the start and end nodes of those relationships.

Yes

Introduced in 5.17

Finds relationships and their start and end nodes using a parallel index seek.

Yes

Introduced in 5.17

Finds relationships using a parallel index seek where the value of the specified relationship property type is within a given range. It also finds the start and end nodes of those relationships.

Yes

Introduced in 5.17

Used by the parallel runtime to fetch all relationships with a specific type from the relationship type index. It also fetches the start and end nodes of those relationships.

Yes

Introduced in 5.17

Used by the parallel runtime to fetch all relationships with at least one of the provided types from the relationship type index. It also fetches the start and end nodes of those relationships.

Yes

Introduced in 5.17

Used by the parallel runtime to fetch all nodes that have at least one of the provided labels from the node label index.

Yes

Introduced in 5.17

Used by the parallel runtime to return one row per item in a list.

Introduced in 5.17

Calls a procedure.

Prepares the result so that it is consumable by the user.

Projects the start and end node of a relationship.

Evaluates a set of expressions, producing a row with the results thereof.

Uses the count store to answer questions about relationship counts.

Yes

Solves quantified path patterns.

Introduced in 5.9

Deletes labels from a node.

Yes

Performs a nested loop. Executes a pattern expression or pattern comprehension.

Performs a nested loop. Tests for the absence of a pattern predicate if an expression predicate evaluates to false.

Performs a nested loop. Tests for the presence of a pattern predicate if an expression predicate evaluates to false.

Performs a nested loop. Tests for the presence of a pattern predicate.

Sets labels on a node.

Yes

Sets properties from a map on a node.

Yes

Sets a property on a node or relationship.

Yes

Used when setting multiple properties on a node or relationship.

Yes

Sets properties from a map on a relationship.

Yes

Finds one or all shortest paths between two previously matches node variables.

Lists the available constraints.

Yes

Lists the available functions.

Yes

Lists the available indexes.

Yes

Lists the available procedures.

Yes

Lists the available configuration settings.

Yes

Lists the available transactions on the current server.

Yes

Skips n rows from the incoming rows.

Sorts rows by a provided key.

Eager

Finds shortest paths from a previously matched node variable to an endpoint that was not previously matched.

Introduced in 5.21

Finds shortest paths between two previously matched node variables. It uses a bidirectional breadth-first search (BFS) algorithm, which performs two BFS invocations at the same time, one from the left boundary node and one from the right boundary node.

Introduced in 5.21

Works like the Foreachoperator but it is only used for executing subqueries.

Fetches all nodes that have all of the first set of provided labels and none of the second provided set of labels from the node label index.

Yes

Introduced in 5.21

Terminate transactions with the given IDs.

Yes

Top

Returns the first 'n' rows sorted by a provided key.

Eager

Works like the Apply operator but will commit the current transaction after a specified number of rows.

Works like the Foreach operator but will commit the current transaction after a specified number of rows.

Used in conjunction with TriadicFilter to solve triangular queries.

Used in conjunction with TriadicBuild to solve triangular queries.

Solves triangular queries, such as the very common 'find my friends-of-friends that are not already my friends'.

Fetches all relationships and their start and end nodes in the database.

Yes

Reads one or more relationships by element id (specified via the function ElementId()) from the relationship store. As the direction is unspecified, two rows are produced for each relationship as a result of alternating the combination of the start and end node.

Yes

Reads one or more relationships by id (specified via the function Id()) from the relationship store. As the direction is unspecified, two rows are produced for each relationship as a result of alternating the combination of the start and end node.

Yes

Examines all values stored in an index, searching for entries containing a specific STRING; for example, in queries including CONTAINS.

Yes

Examines all values stored in an index, searching for entries ending in a specific STRING; for example, in queries containing ENDS WITH.

Yes

Examines all values stored in an index, returning all relationships and their start and end nodes with a particular relationship type and a specified property.

Yes

Finds relationships and their start and end nodes using an index seek.

Yes

Finds relationships and their start and end nodes using an index seek where the value of the property matches a given prefix STRING.

Yes

Fetches all relationships and their start and end nodes with a specific type from the relationship type index.

Yes

Fetches all relationships and their start and end nodes with at least one of the provided types from the relationship type index.

Yes

Concatenates the results from the right-hand operator with the results from the left-hand operator.

Fetches all nodes that have at least one of the provided labels from the node label index.

Yes

Returns one row per item in a list.

Executes a hash join on arbitrary values.

Eager

Traverses variable-length relationships from a given node.

Finds all variable-length relationships between two nodes.

Traverses variable-length relationships from a given node and only returns unique end nodes.

Traverses variable-length relationships from a given node and only returns unique end nodes.

Database hits

Each operator will send a request to the storage engine to do work such as retrieving or updating data. A database hit (DBHits) is an abstract unit of this storage engine work.

These are all the actions that trigger one or more database hits:

  • Create actions

    • Create a node.

    • Create a relationship.

    • Create a new node label.

    • Create a new relationship type.

    • Create a new ID for property keys with the same name.

  • Delete actions

    • Delete a node.

    • Delete a relationship.

  • Update actions

    • Set one or more labels on a node.

    • Remove one or more labels from a node.

  • Node-specific actions

    • Get a node by its ID.

    • Get the degree of a node.

    • Determine whether a node is dense.

    • Determine whether a label is set on a node.

    • Get the labels of a node.

    • Get a property of a node.

    • Get an existing node label.

    • Get the name of a label by its ID, or its ID by its name.

  • Relationship-specific actions

    • Get a relationship by its ID.

    • Get a property of a relationship.

    • Get an existing relationship type.

    • Get a relationship type name by its ID, or its ID by its name.

  • General actions

    • Get the name of a property key by its ID, or its ID by the key name.

    • Find a node or relationship through an index seek or index scan.

    • Find a path in a variable-length expand.

    • Find a shortest path.

    • Ask the count store for a value.

  • Schema actions

    • Add an index.

    • Drop an index.

    • Get the reference of an index.

    • Create a constraint.

    • Drop a constraint.

  • Call a procedure.

  • Call a user-defined function.