mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-11 19:04:35 +00:00
21 lines
409 B
Go
Executable File
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{}{
|
|
"id": "1",
|
|
"age": 43,
|
|
},
|
|
Table: "users",
|
|
})
|
|
fmt.Println(rsp, err)
|
|
}
|