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

Ensures that no node property uniqueness constraints are violated.

Ensures that no relationship property uniqueness constraints are violated.

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 id from the relationship store.

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 Limit operator, 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

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

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

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).

Like EagerAggregation but relies on the ordering of incoming rows. Is not eager.

Like Distinct 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.

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.

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

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

Terminate transactions with the given IDs.

Yes

Top

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

Eager

The TriadicBuild operator is used in conjunction with TriadicFilter to solve triangular queries.

The TriadicFilter operator is used in conjunction with TriadicBuild to solve triangular queries.

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

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

Yes

Reads one or more relationships by ID from the relationship store.

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.