Skip to content

Commit

Permalink
Add transaction id for update
Browse files Browse the repository at this point in the history
  • Loading branch information
lidongze91 committed May 30, 2023
1 parent 3db41d6 commit be25bdf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion component/database/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func (d *Database) GetDocument(table, docId string, limit, skip uint64, fields b
//https://docs.cloudbase.net/api-reference/openapi/database.html#updatedocument
func (d *Database) UpdateDocument(table, docId string, data bson.M, transactionId ...string) (body string, err error) {
//请求参数
path := fmt.Sprintf("/api/v2/envs/%s/databases/%s/documents/%s", d.context.Config.EnvId, table, docId)
path := fmt.Sprintf("/api/v2/envs/%s/databases/%s/documents/%s?transactionId=%s", d.context.Config.EnvId, table, docId, d.appendTransActionId(transactionId...))

return d.core.HttpPatchJson(path, bson.M{
"data": util.JsonEncode(data),
Expand Down

0 comments on commit be25bdf

Please sign in to comment.