Neo4j Delete

Overview

The Neo4j Delete Snap deletes nodes of a given label from your Neo4j database, optionally detaching their relationships first.

Neo4j does not allow a node that still has relationships to be deleted. Select Detach relationships to remove the node's relationships along with the node; clear it to have the Snap fail when a matching node still has relationships.


Neo4j Delete

Supported Accounts

Snap views

Type Description Examples of upstream and downstream Snaps
Input

This Snap has one document input view.

Field values from the incoming document can be referenced in expression-enabled fields using the $ notation.

Output

This Snap has at most one document output view.

Each output document reports the result of the delete for the corresponding input document, including the number of nodes removed.

Learn more about Error handling.

Snap settings

Note: Learn about the common controls in the Snap settings dialog.
Field/Field set Description

Label*

String

Specify a unique name for the Snap. Modify this to be more appropriate, especially if more than one of the same Snaps is in the pipeline.

Default value: Neo4j Delete

Node label*

String/Expression

Enter the label of the nodes to delete.

Default value: None

Example: Customer

Filter

String/Expression

Enter the Cypher predicate that identifies the nodes to delete. Reference node properties with the n. prefix.

CAUTION: Leaving this field empty deletes every node with the specified label.

Default value: None

Example: n.active = false

Detach relationships

Checkbox

Select this checkbox to delete the relationships attached to each matching node along with the node itself, using the Cypher DETACH DELETE clause. If you clear this checkbox, the Snap fails when a matching node still has relationships.

Default status: Selected

Allow unfiltered delete

Checkbox

Select this checkbox to allow the Snap to delete every node of the specified label when the Filter field is empty. When this checkbox is cleared, the Snap fails if the filter is blank, preventing accidental full-label deletes.

Default status: Deselected

Parameters

Use this field set to bind values to named parameters in the Filter field. Add one row per parameter and reference it in the filter as $name, for example n.status = $status.

Name

String

Enter the parameter name as referenced in the filter expression, without the $ prefix.

Default value: None

Example: status

Value

String/Expression

Enter the value to bind to the parameter, or an expression that resolves to the value from the incoming document.

Default value: None

Example: $status

Snap execution

Dropdown list
Choose one of the three modes in which the Snap executes. Available options are:
  • Validate & Execute: Performs limited execution of the Snap and generates a data preview during pipeline validation. Subsequently, performs full execution of the Snap (unlimited records) during pipeline runtime.
  • Execute only: Performs full execution of the Snap during pipeline execution without generating preview data.
  • Disabled: Disables the Snap and all Snaps that are downstream from it.

Default value: Execute only

Troubleshooting

Error Reason Resolution
Node label is required The Node label field is empty. Provide a non-empty node label in the Node label field.
Neo4j operation failed A matching node still has relationships and Detach relationships is not selected. Neo4j does not allow deleting a node that still has attached relationships. Select Detach relationships to remove attached relationships along with the node, or add a Filter that targets only nodes without relationships.
Snap fails with unfiltered delete blocked The Filter field is empty and Allow unfiltered delete is not selected. The Snap blocks the operation to prevent accidentally deleting every node of the label. Provide a filter expression to target specific nodes, or select Allow unfiltered delete to explicitly allow deleting all nodes of the specified label.