Compare two values for equality. | |
Compare two values for inequality. | |
Compare two (potentially empty) values for equality. | |
Compare two (potentially empty) values for inequality. | |
Less than operator. | |
Greater than operator. | |
Less or equal operator. | |
Greater or equal operator. | |
A polymorphic function to calculate a "length" of its first argument. | |
A polymorphic function to test if a sequence contains a certain element. | |
A polymorphic function to find index of an element in a sequence. |
Compare two values for equality.
db>
select 3 = 3.0;
{true}
db>
select 3 = 3.14;
{false}
db>
select [1, 2] = [1, 2];
{true}
db>
select (1, 2) = (x := 1, y := 2);
{true}
db>
select (x := 1, y := 2) = (a := 1, b := 2);
{true}
db>
select 'hello' = 'world';
{false}
Compare two values for inequality.
db>
select 3 != 3.0;
{false}
db>
select 3 != 3.14;
{true}
db>
select [1, 2] != [2, 1];
{false}
db>
select (1, 2) != (x := 1, y := 2);
{false}
db>
select (x := 1, y := 2) != (a := 1, b := 2);
{false}
db>
select 'hello' != 'world';
{true}
Compare two (potentially empty) values for equality.
Works the same as regular =
, but also allows
comparing {}
. Two {}
are considered equal.
db>
select {1} ?= {1.0};
{true}
db>
select {1} ?= <int64>{};
{false}
db>
select <int64>{} ?= <int64>{};
{true}
Compare two (potentially empty) values for inequality.
Works the same as regular !=
, but also allows
comparing {}
. Two {}
are considered equal.
db>
select {2} ?!= {2};
{false}
db>
select {1} ?!= <int64>{};
{true}
db>
select <bool>{} ?!= <bool>{};
{false}
Less than operator.
Return true
if the value of the left expression is less than
the value of the right expression. In EdgeQL any values can be
compared to each other as long as they are of the same type:
db>
select 1 < 2;
{true}
db>
select 2 < 2;
{false}
db>
select 'hello' < 'world';
{true}
db>
select (1, 'hello') < (1, 'world');
{true}
Greater than operator.
Return true
if the value of the left expression is greater
than the value of the right expression. In EdgeQL any values can be
compared to each other as long as they are of the same type:
db>
select 1 > 2;
{false}
db>
select 3 > 2;
{true}
db>
select 'hello' > 'world';
{false}
db>
select (1, 'hello') > (1, 'world');
{false}
Less or equal operator.
Return true
if the value of the left expression is less than
or equal to the value of the right expression. In EdgeQL any
values can be compared to each other as long as they are of the
same type:
db>
select 1 <= 2;
{true}
db>
select 2 <= 2;
{true}
db>
select 3 <= 2;
{false}
db>
select 'hello' <= 'world';
{true}
db>
select (1, 'hello') <= (1, 'world');
{true}
Greater or equal operator.
Return true
if the value of the left expression is greater
than or equal to the value of the right expression. In EdgeQL any
values can be compared to each other as long as they are of the
same type:
db>
select 1 >= 2;
{false}
db>
select 2 >= 2;
{true}
db>
select 3 >= 2;
{true}
db>
select 'hello' >= 'world';
{false}
db>
select (1, 'hello') >= (1, 'world');
{false}
A polymorphic function to test if a sequence contains a certain element.
When the haystack is str
or bytes
,
return true
if needle is contained as a subsequence in it
and false
otherwise.
When the haystack is an array
, return true
if
the array contains the specified element and false
otherwise.
db>
select contains('qwerty', 'we');
{true}
db>
select contains(b'qwerty', b'42');
{false}
db>
select contains([2, 5, 7, 2, 100], 2);
{true}
A polymorphic function to find index of an element in a sequence.
When the haystack is str
or bytes
,
return the index of the first occurrence of needle in it.
When the haystack is an array
, return the index of
the first occurrence of the specific needle element. For
array
inputs it is also possible to provide an
optional from_pos argument to specify the position from
which to start the search.
If the needle is not found, return -1
.
db>
select find('qwerty', 'we');
{1}
db>
select find(b'qwerty', b'42');
{-1}
db>
select find([2, 5, 7, 2, 100], 2);
{0}
db>
select find([2, 5, 7, 2, 100], 2, 1);
{3}