Skip to main content
@tags: crud, create, read, update, delete, operations, nodes, edges, vectors

Create

Create Nodes using AddN

Syntax
Example 1: Adding an empty user node
  • Schema:
  • Query:
  • cURL:
  • Python SDK:
  • TypeScript SDK:
Example 2: Adding a user with parameters
  • Schema:
  • Query:
  • cURL:
  • Python SDK:
  • TypeScript SDK:
Example 3: Adding a user with predefined properties
  • Schema:
  • Query:
  • cURL:
  • Python SDK:
  • TypeScript SDK:

Create Edges using AddE

Syntax
Example 1: Creating a simple follows relationship
  • Schema:
  • Query:
  • cURL:
  • Python SDK:
  • TypeScript SDK:
Example 2: Creating a detailed friendship with properties
  • Schema:
  • Query:
  • cURL:
  • Python SDK:
  • TypeScript SDK:
Example 3: Traversal Example
  • Schema:
  • Query:
  • cURL:
  • Python SDK:
  • TypeScript SDK:

Create Vectors using AddV

Syntax
Note: Currently only supports [F64] to represent the vector. Support for [F32] and binary vectors added in the future.
Example 1: Creating a vector with no properties
  • Schema:
  • Query:
  • cURL:
  • Python SDK:
  • TypeScript SDK:
Example 2: Creating a vector with properties
  • Schema:
  • Query:
  • cURL:
  • Python SDK:
  • TypeScript SDK:
Example 3: Creating a vector and connecting it to a node
  • Schema:
  • Query:
  • cURL:
  • Python SDK:
  • TypeScript SDK:
Example 4: Using the built-in Embed function
  • Built-in Embed function: don’t need to send array of floats, just send the text.
  • Schema:
  • Query:
  • Environment variables (OpenAI example):
  • cURL:
  • Python SDK:
  • TypeScript SDK:

Select

Select Nodes using N

Syntax
Example 1: Selecting a user by ID
  • Schema:
  • Query:
  • cURL:
  • Python SDK:
  • TypeScript SDK:
Example 2: Selecting all users
Notes:
  • Query:
  • cURL:
  • Python SDK:
  • TypeScript SDK:

Select Edges using E

Syntax
Example 1: Selecting a follows edge by ID
  • Schema:
  • Query:
  • cURL:
  • Python SDK:
  • TypeScript SDK:
Example 2: Selecting all follows edges
  • Schema:
  • Query:
  • cURL:
  • Python SDK:
  • TypeScript SDK:

Select Vectors using V

Syntax
Example 1: Selecting a vector by ID
  • Schema:
  • Query:
  • cURL:
  • Python SDK:
  • TypeScript SDK:

Update using UPDATE

Syntax

Note: Usually you will want to have a separate query to create items and another query to update them.

Example 1: Updating a person’s profile

Note: You only need to include fields you want to change. Any omitted properties stay the same.
  • Schema:
  • Query:
  • cURL:
  • Python SDK:
  • TypeScript SDK:

Error Examples:

  • Schema:
  • Query:

DELETE using DROP

  • Drops any traversal that returns elements (nodes, edges, or vectors).
  • If empty traversal, it will not drop anything.
  • Dropping a node or vector will also drop all its edges.

Syntax

Example 1: Removing a user node by ID

  • Schema:
  • Query:
  • cURL:
  • Python SDK:
  • TypeScript SDK:

Example 2: Removing outgoing neighbors

  • Schema:
  • Query:
  • cURL:
  • Python SDK:
  • TypeScript SDK:

Example 3: Removing incoming neighbors

  • Schema:
  • Query:
  • cURL:
  • Python SDK:
  • TypeScript SDK:

Example 4: Removing outgoing edges only

  • Schema:
  • Query:
  • cURL:
  • Python SDK:
  • TypeScript SDK:

Example 5: Removing incoming edges only

  • Schema:
  • Query:
  • cURL:
  • Python SDK:
  • TypeScript SDK: