Overview

Generally queries will consist of a where clause plus optional modifiers controlling the specific subset of results returned.

🚧 Query limitations

Hellar Platform v1.0.0 introduced a number of limitations due to the switch to using GroveDB. See details in pull requests 77 and 230 that implemented these changes.

Query validation details may be found here along with the associated validation tests.

Where Clause

The Where clause must be a non-empty array containing not more than 10 conditions. For some operators, value will be an array. See the following general syntax example:

❗️

As of Hellar Platform v1.0.0, all fields referenced in a query’s where clause must be defined in the same index. This includes $createdAt and $updatedAt.

{ where: [ [<fieldName>, <operator>, <value>], [<fieldName>, <array operator>, [<value1>, <value2>]] ] }

Fields

Valid fields consist of the indices defined for the document being queried. For example, the HPNS data contract defines three indices:

Index Field(s) Index Type Unique
normalizedParentDomainName, normalizedLabel Compound Yes
records.hellarUniqueIdentityId Single Field Yes
records.hellarAliasIdentityId Single Field No

Comparison Operators

Equal

Name Description
== Matches values that are equal to a specified value

Range

🚧 Hellar Platform v1.0.0 notes

Name Description
< Matches values that are less than a specified value
<= Matches values that are less than or equal to a specified value
>= Matches values that are greater than or equal to a specified value
> Matches values that are greater than a specified value
in Matches all document(s) where the value of the field equals any value in the specified array
Array may include up to 100 (unique) elements

Array Operators

Name Description
length Selects documents if the array field is a specified size (integer)
contains - Matches arrays that contain all elements specified in the query condition array

Evaluation Operators

Name Description
startsWith Selects documents where the value of a field begins with the
specified characters (string, <= 255 characters). Must include an orderBy statement.