【TcaplusDB知识库】RESTfulAPI. for List表-[PB] [PB] ListDeleteRecord.介绍


【TcaplusDB知识库】RESTfulAPI2.0 for List表-[PB] ListDeleteRecord2.0介绍

简介

在List PB表中删除对应Key下的指定下标的记录。

  • Index: 指定要删除记录的下标。

POST http://{Tcaplus_REST_URL}

请求语法

Http请求

#腾讯云控制台 RESTful Endpoint, ip:80, 端口默认80
http://172.17.0.22
#TcaplusDB本地docker版 RESTful Endpoint, ip:31001, 端口默认31001
http://9.135.8.93:31001

Http头

x-tcaplus-target:Tcaplus.ListDeleteRecord
x-tcaplus-app-id:{string}
x-tcaplus-zone-id:{string}
x-tcaplus-protocol-version:{string}
x-tcaplus-table-name:{string}
x-tcaplus-pwd-md5:{string}
x-tcaplus-result-flag:result_flag
x-tcaplus-version:{string}
x-tcaplus-data-version-check:{string}
x-tcaplus-idl-type:protobuf

参数说明:

名称是否必填限制条件说明
x-tcaplus-target Tcaplus.ListDeleteRecord
x-tcaplus-version Tcaplus3.50.0
x-tcaplus-app-id 对应业务id编号(aka,集群接入id)
x-tcaplus-zone-id 对应zone编号(aka,表格组id)
x-tcaplus-protocol-version 对应protocol版本号,默认2.0
x-tcaplus-table-name 对应表名
x-tcaplus-pwd-md5 业务密码(aka,集群访问密码),传入计算后的md5值
x-tcaplus-idl-type protobuf
x-tcaplus-result-flag 0:操作成功后不返回数据1:操作成功后返回和请求一致的数据2:操作成功后返回本次update操作后的数据3:操作成功后返回tcapsvr端操作前的数据
x-tcaplus-data-version-check   1:检测记录版本号,只有当该版本号与服务器端的版本号相同时,该版本号才会自增2:不检测记录版本号,强制把客户端的记录版本号写入到服务器中3:不检测记录版本号,将服务器端的版本号自增
x-tcaplus-data-version   具体的version值

 

示例:

x-tcaplus-target:Tcaplus.ListDeleteRecord
x-tcaplus-app-id:3
x-tcaplus-zone-id:1
x-tcaplus-protocol-version:2.0
x-tcaplus-table-name:tb_online_list
x-tcaplus-pwd-md5:4e81984efccfb4982333aeb1ff7968d5
x-tcaplus-result-flag:2
x-tcaplus-version:Tcaplus3.50.0
x-tcaplus-data-version-check: 3
x-tcaplus-idl-type:protobuf

Data

使用json格式表示记录相关信息。指定要删除记录的主键及对应记录的下标。

  • Index: 指定要删除记录的下标

  • Record: 指定要删除记录的主键

{
  "Record": {
              "openid": 1,
              "timekey": "1",
              "tconndid": 1
      },
  "Index": 0
}

完整请求示例

curl -i -XPOST -H 'x-tcaplus-target: Tcaplus.ListDeleteRecord' -H 'x-tcaplus-app-id: 70' -H 'x-tcaplus-zone-id: 1' -H 'x-tcaplus-protocol-version: 2.0' -H 'x-tcaplus-table-name: tb_online_list' -H 'x-tcaplus-pwd-md5: 0972ad76decf4d11a69e2e0d9af335da' -H 'x-tcaplus-result-flag: 1' -H 'x-tcaplus-version: Tcaplus3.50.0' -H 'x-tcaplus-data-version-check: 1' -H 'x-tcaplus-idl-type: protobuf' http://172.17.32.17 -d '{
  "Index": 3,
  "Record": {
      "openid":1,
      "tconndid":1,
      "timekey": "1"
  }
}'

返回语法

返回参数说明

参数名说明
参数名 说明
ErrorCode 返回码
ErrorMsg 返回信息
RecordVersion 当前记录的版本号
Index 当前记录所在的下标
Record Json格式,成功的记录

 

返回示例

成功示例

{
  "ErrorCode": 0,
  "ErrorMsg": "Succeed",
  "RecordVersion": -1,
  "Index": 3,
  "Record": {
      "openid": 1,
      "tconndid": 1,
      "timekey": "1",
      "gamesvrid": "",
      "logintime": 0,
      "lockid": [],
      "pay": {
          "total_money": 0,
          "pay_times": 0
      }
  }
}

失败示例

{
  "ErrorCode": 261,
  "ErrorMsg": "Record does not exist"
}

img

TcaplusDB是腾讯出品的分布式NoSQL数据库,存储和调度的代码完全自研。具备缓存+落地融合架构、PB级存储、毫秒级时延、无损水平扩展和复杂数据结构等特性。同时具备丰富的生态、便捷的迁移、极低的运维成本和五个九高可用等特点。客户覆盖游戏、互联网、政务、金融、制造和物联网等领域。