Token Functions in WHERE Clause

The token functions in this section can only be used in the WHERE clause of a LOAD statement.

Function name Output type Description of function

to_int( main_string )

INT

Converts main_string to an integer value.

to_float( main_string )

FLOAT

Converts main_string to a float value.

concat( string1, string2 )

STRING

Returns a string which is the concatenation of string1 and string2 .

token_len( main_string )

INT

Returns the length of main_string.

gsql_is_not_empty_string( main_string )

BOOL

Returns true if main_string is empty after removing white space. Returns false otherwise.

gsql_token_equal( string1, string2 )

BOOL

Returns true if string1 is exactly the same (case-sensitive) as string2 . Returns false otherwise.

gsql_token_ignore_case_equal( string1, string2 )

BOOL

Returns true if string1 is exactly the same (case-insensitive) as string2. Returns false otherwise.

gsql_is_true( main_string )

BOOL

Returns true if main_string is either "t" or "true" (case-insensitive). Returns false otherwise.

gsql_is_false( main_string )

BOOL

Returns true if main_string is either "f" or "false" (case-insensitive). Returns false otherwise.

Example

These functions can be used as part of expression in the WHERE clause. For example, the following statement only loads a record if the score column of a record is greater than 95.5:

LOAD f TO VERTEX Person
  VALUES ($"name", $"score")
  WHERE to_float($"score") > 95.5