Skip to content

批量写入时设置了SetReturnPk并没有返回主键 #86

@lhlyu

Description

@lhlyu
  • go版本: 1.17
  • sdk版本: v5.0.6
  • 代码如下
batchWriteReq := &tablestore.BatchWriteRowRequest{}

for _, data := range datas {
      putRowChange := new(tablestore.PutRowChange)
      putRowChange.TableName = table_im_user_pool
      putPk := new(tablestore.PrimaryKey)
      putPk.AddPrimaryKeyColumn("pk1", "xxxx")
      putPk.AddPrimaryKeyColumnWithAutoIncrement("pk2")
      putRowChange.PrimaryKey = putPk
      putRowChange.AddColumn("col", "xxxxx")
      putRowChange.SetCondition(tablestore.RowExistenceExpectation_IGNORE)
      // 这里设置了
      putRowChange.SetReturnPk()
      batchWriteReq.AddRowChange(putRowChange)
}

// resp内并没有返回主键
resp, err := client.BatchWriteRow(batchWriteReq)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions