String Functions in Queries¶
ArcaneDB provides a set of scalar string functions that can be applied to literal values within get and set statements. These functions transform their argument at query time.
Function |
Description |
|---|---|
|
Converts a string literal to uppercase. |
|
Converts a string literal to title case (first letter of each word capitalised). |
Examples:
-- Filter using title-cased comparison
get * from TestBatch2 where name = title("eve");
-- Update a field to an uppercase value
set TestBatch2 ( name: upper("billy") ) where name = "Bob";
Aggregate Functions¶
Aggregate functions are used within a get statement to compute summary statistics over a set of records. They operate over the values of a specified field, optionally constrained by a where clause.
Syntax:
get <agg_func>(<field>), ... from <bucket> [where <condition>];
Supported aggregate functions:
Function |
Description |
|---|---|
|
Arithmetic mean of non-null values. |
|
Middle value when records are sorted; interpolated for even counts. |
|
Smallest value. |
|
Largest value. |
|
Population standard deviation. |
|
Sum of all non-null values. |
|
Total number of records in the result set. |
Multiple aggregate functions may be combined in a single get statement.
Examples:
get avg(price), median(price), min(price), max(price), stddev(price)
from Products where in_stock = true;
get sum(price) from Products;
get count(*) from Products;