云数据库 GEMINIDB-接口兼容性介绍:支持的表达式

时间:2024-10-28 17:36:32

支持的表达式

GeminiDB DynamoDB中的ConditionExpression支持的函数语法如下:

function ::=
    attribute_exists (path)
    | attribute_not_exists (path)
    | attribute_type (path, type)
    | begins_with (path, substr)
    | contains (path, operand)
contains(path,operand)中operand只能是属性值(即传入的value占位符)。

GeminiDB DynamoDB中的UpdateExpression语法如下:

update-expression ::=
     [ SET action [, action] ... ]
     [ REMOVE action [, action] ...]
     [ ADD action [, action] ... ]
     [ DELETE action [, action] ...]

 set-action ::=
     path =value

 value ::=
     operand
     | operand '+' operand
     | operand '-' operand

 operand ::=
     path | function

 function ::=
     if_not_exists (path, value)
     | list_append (list1, list2)

 remove-action ::=
     path

 add-action ::=
     path value

 delete-action ::=
     path value
SET path = operand语法中,不支持operand是path的场景。
SET path = operand1 '+'|'-' operand2语法中,operand1必须等于path,operand2必须是属性值
SET path = if_not_exists (path, value)语法中,两个path必须相等,且value只能是表达式属性值。
所有的value只能是占位符,比如':placeholder'。
support.huaweicloud.com/cassandraug-nosql/nosql_02_0604.html