列出Keys

列出集合中的键,支持分页和前缀过滤。

身份验证

需要内部身份验证。通过 X-Glue-Authentication 头部或 apikeysecret 头部传递凭据。

路径参数

参数 类型 描述
col string 集合名称

查询参数

参数 类型 描述
limit integer 返回的最大键数(默认:100)
prefix string 按前缀过滤键

请求示例

1curl "https://api.hola.cloud/v1/collections/users/keys?prefix=user:&limit=10" \
2  -H "X-Glue-Authentication: YOUR_AUTH_TOKEN"

响应示例

1HTTP/1.1 200 OK
2Content-Type: application/json
 1{
 2  "items": [
 3    {
 4      "key": "user:1001",
 5      "value": { "name": "Alice" },
 6      "version": 1,
 7      "updatedAt": "2025-06-20T15:30:00Z"
 8    },
 9    {
10      "key": "user:1002",
11      "value": { "name": "Bob" },
12      "version": 1,
13      "updatedAt": "2025-06-21T08:00:00Z"
14    }
15  ],
16  "next": "user:1002"
17}

错误代码

状态 代码 描述
403 forbidden Missing authentication headers
404 not_found 未找到集合
500 internal_error 服务器内部错误

评论

发表评论