Skip to main content
@tags: conditionals, where, filter, eq, neq, gt, gte, lt, lte, contains, startswith, endswith, and, or, not, logic

Anonymous Traversal

Syntax

Example 1: Filter by relationship count

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

Example 2: Property-based filtering with anonymous traversal

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

Conditional Steps

Note: For multiple conditions, see Multiple Conditions Steps.

Filtering using WHERE

Syntax
Notes:
  • The condition in the WHERE step must evaluate to a boolean value.
  • If the condition is not met, the element will be filtered out from the results.
Comparison Operators
String, Boolean, Date, and Number Comparisons
  • ::EQ(value): Equals (e.g. ::WHERE(_::{status}::EQ("active")))
  • ::NEQ(value): Not equals (e.g. ::WHERE(_::{age}::NEQ(25)))
Number and Date Comparisons
  • ::GT(value): Greater than (e.g. ::WHERE(_::{age}::GT(25)))
  • ::LT(value): Less than (e.g. ::WHERE(_::{age}::LT(30)))
  • ::GTE(value): Greater than or equal (e.g. ::WHERE(_::{rating}::GTE(4.5)))
  • ::LTE(value): Less than or equal (e.g. ::WHERE(_::{priority}::LTE(2)))
Example 1: Basic filtering with WHERE
  • Schema:
  • Query:
  • cURL:
  • Python SDK:
  • TypeScript SDK:
Example 2: String and equality filtering
  • Schema:
  • Query:
  • cURL:
  • Python SDK:
  • TypeScript SDK:

Filter by Relationship using EXISTS

Syntax
Example 1: Using EXISTS for relationship filtering
  • Schema:
  • Query:
  • cURL:
  • Python SDK:
  • TypeScript SDK:

Multiple Conditions Steps

Filter by multiple conditions using AND and/or OR.

Syntax

Example 1: Using AND for range filtering

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

Example 2: Using OR for multiple valid options

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

Example 3: Complex nested AND and OR conditions

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