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.
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>]] ] }
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 |
Name | Description |
---|---|
== | Matches values that are equal to a specified value |
🚧 Hellar Platform v1.0.0 notes
- Only one range operator is allowed in a query (except for between behavior)
- The
in
operator is only allowed for last two indexed properties- Range operators are only allowed after
==
andin
operators- Range operators are only allowed for the last two fields used in the where condition
- Queries using range operators must also include an
orderBy
statement
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 |
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 |
Name | Description |
---|---|
startsWith | Selects documents where the value of a field begins with the |
specified characters (string, <= 255 characters). Must include an orderBy statement. |