You need to enable JavaScript to run this app.
导航
Collection 数据过滤删除任务
最近更新时间:2025.04.27 17:35:31首次发布时间:2025.04.27 17:35:31
我的收藏
有用
有用
无用
无用

概述

按特定条件批量删除Collection中的数据

请求参数

参数名

类型

必须

说明

子字段

类型

必选

说明

task_type

string

任务类型,填入 filter_delete

task_params

map

任务参数

collection_name

string

Collection 名称,必填

filter_conds

map

过滤条件,支持 must 、must_nor、range、range_out 算子,使用参考标量过滤
过滤更新 city 为 beijing 且 user_id (0, 4) 之间的数据

[
    {
        "op": "must",
        "field": "city",
        "conds": ["beijing"]
    },
    {
        "op": "range",
        "field": "user_id",
        "gt": 0,
        "lt": 4
    },

]

need_confirm

bool

为false时可跳过人工确认环节,默认为true。为 true 时需要执行 任务更新 接口

tos_path

string

在实际执行数据删前,将数据备份到指定目录,参考数据导出功能。

file_type

string

备份文件类型 json 或者 parquet,默认为 parquet

说明

若要将数据备份至TOS,请先授权 VikingDB 跨服务访问 TOS 去授权

示例

请求参数

curl -i -X POST \
  -H 'Content-Type: application/json' \
  -H 'Authorization: HMAC-SHA256 ***' \
  https://api-vikingdb.volces.com/api/task/create \
  -d '{
    "task_type": "filter_delete",
    "task_params": {
        "collection_name": "example", #colletcion 名称
        "filter_conds": [
            {
                "op": "must",
                "field": "city",
                "conds": ["beijing"]
            },
            {
                "op": "range",
                "field": "user_id",
                "gt": 0,
                "lt": 4
            },
        ]
    }
}'

返回值

属性

说明

task_id

uuid

后续处理

如果需要人工确认,可执行任务更新操作