Files
m3o-go/examples/db/update/updateARecord/main.go
2021-12-09 14:20:17 +00:00

23 lines
373 B
Go
Executable File

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