Skip to main content
@tags: properties, access, fields, attributes, projection, select

Property Access

Select Specific Properties using {}

Syntax
Notes:
  • Property access allows you to return only the fields you need, reducing data transfer and improving query performance.
Example 1: Basic property selection
  • Schema:
  • Query:
  • cURL:
  • Python SDK:
  • TypeScript SDK:
Example 2: Property selection with renaming
  • Schema:
  • Query:
  • cURL:
  • Python SDK:
  • TypeScript SDK:

Access IDs using ID

Syntax
Note:
  • Every element in HelixDB has a unique ID that can be accessed using the ::ID syntax.
Example 1: Getting element IDs
  • Schema:
  • Query:
  • cURL:
  • Python SDK:
  • TypeScript SDK:

Include All Properties using ..

Use the spread operator to include all properties while optionally remapping specific fields.
Syntax
Example 1: Property aliasing with spread operator
  • Schema:
  • Query:
  • cURL:
  • Python SDK:
  • TypeScript SDK:

Property Addition

Syntax

Notes:
  • Property additions allow you to compute derived values and add metadata to your query results without modifying the underlying schema.

Example 1: Adding computed properties with traversals

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

Property Exclusion

Syntax

Notes:
  • Property exclusion is useful when you want to return most properties but hide sensitive or unnecessary fields like passwords, internal IDs, or large data fields.

Example 1: Excluding sensitive properties

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

Property Remappings

Simple Remapping

Syntax
Notes:
  • You can usually use the name directly
  • If you want to be more explicit or there are name clashes, you can use the _:: operator.
Example 1: Basic property remapping
  • Schema:
  • Query:
  • cURL:
  • Python SDK:
  • TypeScript SDK:

Nested Remapping

Syntax
Notes:
  • If we were to access the ID using: nested_field: ID. It would be the ID of the inner_item item not the item_name item due to the tighter scope.
  • When accessing properties in nested mappings, scope matters. Use the explicit item_name::property syntax to access properties from outer scopes to avoid ambiguity.
Example 1: User posts with nested remappings
  • Schema:
  • Query:
  • cURL:
  • Python SDK:
  • TypeScript SDK: