Neo4j

App · 21 actions

Read and change your Neo4j graph: run Cypher queries, create, find, update and delete nodes and relationships, and manage indexes and constraints. Start a workflow when a node or relationship is added or a query's results change.

Actions

ActionWhat it does
Change node labelsAdd labels to, or take labels off, the nodes with a label whose properties have the values given.
Count nodesCount the nodes with a label whose properties have the values given.
Create indexIndex nodes with a label by one or more properties, so finding them by those values is fast.
Create nodeCreate a node with a label and properties.
Create or update nodeFind the node with a label and key values, such as an email address, or create it if there is none, then set properties on it.
Create relationshipConnect a node to another with a relationship, such as a Person WORKS_AT a Company, finding each node by its property values.
Create uniqueness constraintRequire every node with a label to have a different value of a property (or combination of properties).
Delete constraintDelete a constraint.
Delete indexDelete an index.
Delete nodesDelete the nodes with a label whose properties have the values given, and by default their relationships.
Delete relationshipsDelete relationships of a type between the nodes that match, leaving the nodes in place.
Find nodesFind nodes with a label whose properties have the values given, optionally sorted by a property.
Find relationshipsFind relationships of a type, with the nodes at each end, optionally only between nodes with given labels and values.
List constraintsList the database's constraints, such as properties that must be unique.
List databasesList the databases on the server with their status.
List indexesList the database's indexes, what each covers and whether it is ready.
List labelsList every node label in the database.
List property namesList every property name used in the database.
List relationship typesList every relationship type in the database.
Run a Cypher queryRun any Cypher statement, with values passed as parameters, and get its rows and what it changed.
Update nodesSet or clear properties on the nodes with a label whose properties have the values given.

Change node labels

Add labels to, or take labels off, the nodes with a label whose properties have the values given.

Inputs

LabellabeltextRequired
The label the nodes have now.
Where these matchmatch_propertiesobjectRequired
The property values the nodes must have, such as email = alice@example.com. Every one must match.
Add labelsadd_labelslist
Labels to add, such as Customer.
Remove labelsremove_labelslist
Labels to take off.
Databasedatabasetext
The database to use. Leave blank for the connection's database.

Outputs

countnumber
How many nodes matched
labels_addednumber
How many labels were added
labels_removednumber
How many labels were taken off
nodeslist
The nodes, as they are now
Example output
{
  "count": 1,
  "labels_added": 1,
  "labels_removed": 0,
  "nodes": [
    {
      "element_id": "4:ff04df25-ff2b-4b55-98f8-6888297b025e:0",
      "labels": [
        "Person",
        "Customer"
      ],
      "properties": {
        "age": 42,
        "email": "alice@example.com",
        "name": "Alice Example"
      }
    }
  ]
}

Count nodes

Count the nodes with a label whose properties have the values given.

Inputs

Labellabeltext
Only nodes with this label. Leave blank for every node.
Where these matchmatch_propertiesobject
Only nodes with these property values. Leave empty for every node with the label.
Databasedatabasetext
The database to use. Leave blank for the connection's database.

Outputs

countnumber
How many nodes match
Example output
{
  "count": 1250
}

Create index

Index nodes with a label by one or more properties, so finding them by those values is fast. Nothing changes if the index is already there.

Inputs

LabellabeltextRequired
The label of the nodes to index.
Propertiesindex_propertieslistRequired
The properties to index.
Index nameindex_nametext
A name for the index. Leave blank for one made from the label and properties.
Databasedatabasetext
The database to use. Leave blank for the connection's database.

Outputs

createdtrue/false
False if an index of that name was already there
index_nametext
The index's name
Example output
{
  "created": true,
  "index_name": "Person_email_index"
}

Create node

Create a node with a label and properties.

Inputs

LabellabeltextRequired
The node's label, such as Person. Pick one, or type a new one.
Propertiesnode_propertiesobject
The node's properties, such as name = Alice. Each value is text, a number, true or false, or a list of these.
More labelsextra_labelslist
Further labels to give the node, such as Customer.
Databasedatabasetext
The database to use. Leave blank for the connection's database.

Outputs

nodeobject
The node
Example output
{
  "node": {
    "element_id": "4:ff04df25-ff2b-4b55-98f8-6888297b025e:0",
    "labels": [
      "Person"
    ],
    "properties": {
      "age": 42,
      "email": "alice@example.com",
      "name": "Alice Example"
    }
  }
}

Create or update node

Find the node with a label and key values, such as an email address, or create it if there is none, then set properties on it.

Inputs

LabellabeltextRequired
The node's label, such as Person.
Find it bykey_propertiesobjectRequired
The values that identify the node, such as email = alice@example.com.
Set when createdon_create_propertiesobject
Properties to set only when the node is new, such as created_at.
Set when foundon_match_propertiesobject
Properties to set only when the node was already there.
Databasedatabasetext
The database to use. Leave blank for the connection's database.

Outputs

createdtrue/false
True if the node was created, false if it was found
nodeobject
The node
Example output
{
  "created": true,
  "node": {
    "element_id": "4:ff04df25-ff2b-4b55-98f8-6888297b025e:0",
    "labels": [
      "Person"
    ],
    "properties": {
      "age": 42,
      "email": "alice@example.com",
      "name": "Alice Example"
    }
  }
}

Create relationship

Connect a node to another with a relationship, such as a Person WORKS_AT a Company, finding each node by its property values.

Inputs

From labelfrom_labeltextRequired
The label of the node the relationship starts from.
From node wherefrom_propertiesobjectRequired
Property values that find the start node, such as email = alice@example.com.
Relationship typerelationship_typetextRequired
The relationship's type, such as WORKS_AT. Pick one, or type a new one.
To labelto_labeltextRequired
The label of the node the relationship points to.
To node whereto_propertiesobjectRequired
Property values that find the end node, such as name = Acme.
Relationship propertiesrelationship_propertiesobject
Properties for the relationship itself, such as since = 2021.
Skip if already connectedskip_existingtrue/false
Don't add a second relationship of this type between the same two nodes. Off by default.Default: false.
Databasedatabasetext
The database to use. Leave blank for the connection's database.

Outputs

countnumber
How many relationships the step returned
creatednumber
How many were new (fewer when existing ones were skipped)
relationshipslist
The relationships, each with the nodes at its ends
Example output
{
  "count": 1,
  "created": 1,
  "relationships": [
    {
      "from": {
        "element_id": "4:ff04df25-ff2b-4b55-98f8-6888297b025e:0",
        "labels": [
          "Person"
        ],
        "properties": {
          "age": 42,
          "email": "alice@example.com",
          "name": "Alice Example"
        }
      },
      "relationship": {
        "element_id": "5:ff04df25-ff2b-4b55-98f8-6888297b025e:2",
        "end_element_id": "4:ff04df25-ff2b-4b55-98f8-6888297b025e:1",
        "properties": {
          "since": 2021
        },
        "start_element_id": "4:ff04df25-ff2b-4b55-98f8-6888297b025e:0",
        "type": "WORKS_AT"
      },
      "to": {
        "element_id": "4:ff04df25-ff2b-4b55-98f8-6888297b025e:1",
        "labels": [
          "Company"
        ],
        "properties": {
          "name": "Acme Corporation"
        }
      }
    }
  ]
}

Create uniqueness constraint

Require every node with a label to have a different value of a property (or combination of properties). Nothing changes if it is already there.

Inputs

LabellabeltextRequired
The label of the nodes it applies to.
Propertiesconstraint_propertieslistRequired
The property, or properties together, that must be unique.
Constraint nameconstraint_nametext
A name for the constraint. Leave blank for one made from the label and properties.
Databasedatabasetext
The database to use. Leave blank for the connection's database.

Outputs

constraint_nametext
The constraint's name
createdtrue/false
False if a constraint of that name was already there
Example output
{
  "constraint_name": "Person_email_unique",
  "created": true
}

Delete constraint

Delete a constraint. The data stays.

Inputs

Constraintconstraint_nametextRequired
The constraint to delete. Pick one, or type its name.
Databasedatabasetext
The database to use. Leave blank for the connection's database.

Outputs

constraint_nametext
The constraint's name
droppedtrue/false
False if there was no constraint of that name
Example output
{
  "constraint_name": "Person_email_unique",
  "dropped": true
}

Delete index

Delete an index. The data it indexed stays.

Inputs

Indexindex_nametextRequired
The index to delete. Pick one, or type its name.
Databasedatabasetext
The database to use. Leave blank for the connection's database.

Outputs

droppedtrue/false
False if there was no index of that name
index_nametext
The index's name
Example output
{
  "dropped": true,
  "index_name": "Person_email_index"
}

Delete nodes

Delete the nodes with a label whose properties have the values given, and by default their relationships.

Inputs

LabellabeltextRequired
The label of the nodes to delete.
Where these matchmatch_propertiesobjectRequired
The property values the nodes must have, such as email = alice@example.com. Every one must match.
Delete their relationships toodetachtrue/false
On by default. Off refuses to delete a node that still has relationships.Default: true.
Databasedatabasetext
The database to use. Leave blank for the connection's database.

Outputs

nodes_deletednumber
How many nodes were deleted
relationships_deletednumber
How many of their relationships went with them
Example output
{
  "nodes_deleted": 1,
  "relationships_deleted": 2
}

Delete relationships

Delete relationships of a type between the nodes that match, leaving the nodes in place.

Inputs

Relationship typerelationship_typetextRequired
The type of the relationships to delete.
From labelfrom_labeltext
The label of the node the relationship starts from. Leave blank for any.
From node wherefrom_propertiesobject
Property values that find the start node, such as email = alice@example.com. Leave empty for any.
To labelto_labeltext
The label of the node the relationship points to. Leave blank for any.
To node whereto_propertiesobject
Property values that find the end node, such as name = Acme. Leave empty for any.
Relationship wherematch_propertiesobject
Only relationships with these property values.
Databasedatabasetext
The database to use. Leave blank for the connection's database.

Outputs

relationships_deletednumber
How many relationships were deleted
Example output
{
  "relationships_deleted": 1
}

Find nodes

Find nodes with a label whose properties have the values given, optionally sorted by a property.

Inputs

Labellabeltext
Only nodes with this label. Leave blank for any label.
Where these matchmatch_propertiesobject
Only nodes with these property values. Leave empty for every node with the label.
Sort byorder_bytext
The property to sort by. Leave blank for no order.
Highest firstdescendingtrue/false
Sort from the highest value down. Off sorts lowest first.Default: false.
How manylimitnumber
The most nodes to return, up to 1000. Defaults to 100.From 1 to 1000.
Skipskipnumber
How many to skip first, to read the next page. Defaults to 0.At least 0.
Databasedatabasetext
The database to use. Leave blank for the connection's database.

Outputs

countnumber
How many
nodeslist
The nodes
Example output
{
  "count": 1,
  "nodes": [
    {
      "element_id": "4:ff04df25-ff2b-4b55-98f8-6888297b025e:0",
      "labels": [
        "Person"
      ],
      "properties": {
        "age": 42,
        "email": "alice@example.com",
        "name": "Alice Example"
      }
    }
  ]
}

Find relationships

Find relationships of a type, with the nodes at each end, optionally only between nodes with given labels and values.

Inputs

Relationship typerelationship_typetext
Only relationships of this type. Leave blank for any type.
From labelfrom_labeltext
The label of the node the relationship starts from. Leave blank for any.
From node wherefrom_propertiesobject
Property values that find the start node, such as email = alice@example.com. Leave empty for any.
To labelto_labeltext
The label of the node the relationship points to. Leave blank for any.
To node whereto_propertiesobject
Property values that find the end node, such as name = Acme. Leave empty for any.
Relationship wherematch_propertiesobject
Only relationships with these property values.
How manylimitnumber
The most to return, up to 1000. Defaults to 100.From 1 to 1000.
Databasedatabasetext
The database to use. Leave blank for the connection's database.

Outputs

countnumber
How many
relationshipslist
The relationships, each with the nodes at its ends
Example output
{
  "count": 1,
  "relationships": [
    {
      "from": {
        "element_id": "4:ff04df25-ff2b-4b55-98f8-6888297b025e:0",
        "labels": [
          "Person"
        ],
        "properties": {
          "age": 42,
          "email": "alice@example.com",
          "name": "Alice Example"
        }
      },
      "relationship": {
        "element_id": "5:ff04df25-ff2b-4b55-98f8-6888297b025e:2",
        "end_element_id": "4:ff04df25-ff2b-4b55-98f8-6888297b025e:1",
        "properties": {
          "since": 2021
        },
        "start_element_id": "4:ff04df25-ff2b-4b55-98f8-6888297b025e:0",
        "type": "WORKS_AT"
      },
      "to": {
        "element_id": "4:ff04df25-ff2b-4b55-98f8-6888297b025e:1",
        "labels": [
          "Company"
        ],
        "properties": {
          "name": "Acme Corporation"
        }
      }
    }
  ]
}

List constraints

List the database's constraints, such as properties that must be unique.

Inputs

Databasedatabasetext
The database to use. Leave blank for the connection's database.

Outputs

constraintslist
The constraints
countnumber
How many
Example output
{
  "constraints": [
    {
      "entity_type": "NODE",
      "labels_or_types": [
        "Person"
      ],
      "name": "Person_email_unique",
      "owned_index": "Person_email_unique",
      "properties": [
        "email"
      ],
      "type": "UNIQUENESS"
    }
  ],
  "count": 1
}

List databases

List the databases on the server with their status.

Inputs

None.

Outputs

countnumber
How many
databaseslist
The databases
Example output
{
  "count": 1,
  "databases": [
    {
      "access": "read-write",
      "default": true,
      "home": true,
      "name": "neo4j",
      "status": "online",
      "type": "standard"
    }
  ]
}

List indexes

List the database's indexes, what each covers and whether it is ready.

Inputs

Databasedatabasetext
The database to use. Leave blank for the connection's database.

Outputs

countnumber
How many
indexeslist
The indexes
Example output
{
  "count": 1,
  "indexes": [
    {
      "entity_type": "NODE",
      "labels_or_types": [
        "Person"
      ],
      "name": "Person_email_index",
      "owning_constraint": "",
      "properties": [
        "email"
      ],
      "state": "ONLINE",
      "type": "RANGE"
    }
  ]
}

List labels

List every node label in the database.

Inputs

Databasedatabasetext
The database to use. Leave blank for the connection's database.

Outputs

countnumber
How many
labelslist
The labels
Example output
{
  "count": 2,
  "labels": [
    "Company",
    "Person"
  ]
}

List property names

List every property name used in the database.

Inputs

Databasedatabasetext
The database to use. Leave blank for the connection's database.

Outputs

countnumber
How many
property_keyslist
The property names
Example output
{
  "count": 3,
  "property_keys": [
    "email",
    "name",
    "since"
  ]
}

List relationship types

List every relationship type in the database.

Inputs

Databasedatabasetext
The database to use. Leave blank for the connection's database.

Outputs

countnumber
How many
relationship_typeslist
The relationship types
Example output
{
  "count": 2,
  "relationship_types": [
    "KNOWS",
    "WORKS_AT"
  ]
}

Run a Cypher query

Run any Cypher statement, with values passed as parameters, and get its rows and what it changed.

Inputs

Cypher queryquerytextRequired
The Cypher statement. Refer to a value given in Parameters as $name rather than typing it in.
Parametersparametersobject
Values the query uses as $name, such as age = 30.
Read onlyread_onlytrue/false
Refuse to change anything, so a query meant only to read can never write. Off by default.Default: false.
Databasedatabasetext
The database to use. Leave blank for the connection's database.

Outputs

countnumber
How many rows
countersobject
What changed, such as nodesCreated, relationshipsDeleted and propertiesSet
fieldslist
The names of the columns
notificationslist
Warnings and hints Neo4j gave about the query
query_typetext
r (read), w (write), rw (read and write) or s (schema)
rowslist
One record per row, keyed by the names the query returns
truncatedtrue/false
True when more than 10000 rows came back and the rest were left out
Example output
{
  "count": 1,
  "counters": {
    "containsUpdates": false,
    "nodesCreated": 0
  },
  "fields": [
    "p.name",
    "p.email"
  ],
  "notifications": [],
  "query_type": "r",
  "rows": [
    {
      "p.email": "alice@example.com",
      "p.name": "Alice Example"
    }
  ],
  "truncated": false
}

Update nodes

Set or clear properties on the nodes with a label whose properties have the values given. Other properties stay as they are.

Inputs

LabellabeltextRequired
The label of the nodes to change.
Where these matchmatch_propertiesobjectRequired
The property values the nodes must have, such as email = alice@example.com. Every one must match.
Setset_propertiesobject
The properties to set, such as status = active. An empty value clears that property.
Clearremove_propertieslist
Properties to take off the nodes altogether.
Databasedatabasetext
The database to use. Leave blank for the connection's database.

Outputs

countnumber
How many nodes matched
nodeslist
The nodes, as they are now
properties_setnumber
How many property values were set or cleared
Example output
{
  "count": 1,
  "nodes": [
    {
      "element_id": "4:ff04df25-ff2b-4b55-98f8-6888297b025e:0",
      "labels": [
        "Person"
      ],
      "properties": {
        "age": 42,
        "email": "alice@example.com",
        "name": "Alice Example",
        "status": "active"
      }
    }
  ],
  "properties_set": 1
}

On this page