键值存储服务 KVS-扫描分区键内kv:请求参数

时间:2024-05-07 09:20:02

请求参数

表2 请求Body参数

参数

是否必选

参数类型

描述

table_name

String

表名,仓内唯一。

  • 长度:[3, 63]
  • 取值字符限制:[a-z0-9_-]+

hint_index_name

String

create_table时指定的索引名。

limit

Integer

数据量不超过1MB时,返回的文档个数,最大100个,默认1MB或者100个文档。

最大值:100

shard_key

Document

要遍历的指定分区键下的kv。

start_sort_key

Document

起始排序键值,默认空表示从头遍历,左闭。

说明:

分页返回时,该值使用上次响应返回的cursor_sort_key

end_sort_key

Document

终止主键或索引键值,默认空表示直到最后,右开。

filter_expression

condition_expression object

过滤表达式,同condition_expression语法。

说明:
  • 允许主键字段作为条件。
  • 在满足shard_key和start_sort_key和end_sortkey的范围内,执行filter逻辑。

projection_fields

Array of strings

对kv_doc有效,返回哪些字段列表,默认全部。

  • 数组元素的字段名或嵌套字段路径用'/'分割,e_name为下标。

projection_blob

projection_blob object

对kv_blob有效,返回局部数据; 默认返回全部数据。

表3 condition_expression

参数

是否必选

参数类型

描述

single_field_expression

single_field_expression object

单字段条件。

multi_field_expression

multi_field_expression object

多字段条件,多个相同优先级的单字段条件。

single_kv_expression

single_kv_expression object

文档表达式。

composed_expression

composed_expression object

组合条件, 逐层同级的子表达式嵌套。

表4 composed_expression

参数

是否必选

参数类型

描述

logic

String

逻辑关系,取值如"$and", "$or", "$nor"。

expressions

Array of expression objects

多个相同优先级且相同逻辑的单字段或多字段条件。

表5 expression

参数

是否必选

参数类型

描述

single_kv_expression

single_kv_expression object

单KV条件。

single_field_expression

single_field_expression object

单字段条件。

multi_field_expression

multi_field_expression object

多字段条件。

表6 single_kv_expression

参数

是否必选

参数类型

描述

func

String

取值:"is_doc", "is_blob", "is_exist", "not_exist"。

表7 single_field_expression

参数

是否必选

参数类型

描述

field

String

条件字段。

func

String

条件函数,取值如"$gt", $lt","$gte", $lte" "$eq", "$ne", "$prefix", "$in","$nin", "$exists"。

value

Document

value和value_array二选一。

  • value条件值,适用于除"$in", "$nin"外的func。
  • 字段名无意义,可以传空,也可以传字段名。
  • $exists值为true/false。
说明:

$prefix操作只适用于string和binary类型。

value_array

Array of strings

"value"和"value_array"二选一。

  • "value_array" 条件值列表, 值用于"$in", "$nin"。
表8 multi_field_expression

参数

是否必选

参数类型

描述

logic

String

多字段条件,多个相同优先级的单字段条件。

expressions

Array of single_field_expression objects

多个相同逻辑操作的单字段条件。

表9 projection_blob

参数

是否必选

参数类型

描述

with_attr

Boolean

是否返回kv_blob的属性信息, 默认返回。

offset

Integer

value部分的偏移位置,超过实际size不返回,默认0。

len

Integer

数据长度,默认offset后全部数据。

support.huaweicloud.com/api-kvs/ScanSkeyKv.html