Files
services/examples/db/update/go/updateARecord.go
Dominic Wong 93059dcfa0 Gifs API (#223)
* gifs service

* Commit from GitHub Actions (Publish APIs & Clients)

Co-authored-by: domwong <domwong@users.noreply.github.com>
2021-10-06 17:48:31 +01:00

21 lines
409 B
Go
Executable File

package example
import (
"fmt"
"github.com/micro/services/clients/go/db"
"os"
)
// Update a record in the database. Include an "id" in the record to update.
func UpdateArecord() {
dbService := db.NewDbService(os.Getenv("MICRO_API_TOKEN"))
rsp, err := dbService.Update(&db.UpdateRequest{
Record: map[string]interface{}{
"age": 43,
"id": "1",
},
Table: "users",
})
fmt.Println(rsp, err)
}