Skip to main content

Iterate over collections with FOR loops

Use FOR loops to perform operations on each element in a collection. The loop variable can reference the entire element or specific properties.
FOR loops process elements sequentially in the order they appear in the collection. This guarantees consistent execution order for dependent operations.
When using the SDKs or curling the endpoint, the query name must match what is defined in the queries.hx file exactly.

Example 1: Iterating over nodes to perform updates

Here’s how to run the query using the SDKs or curl

Example 2: Processing query results

Here’s how to run the query using the SDKs or curl

Example 3: Batch operations on collections

Here’s how to run the query using the SDKs or curl

FOR Loop Destructuring

Extract multiple properties directly in loop variable binding

Nested FOR Loops

Use multiple levels of iteration for complex operations