Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/guregu/dynamo
Browse files Browse the repository at this point in the history
  • Loading branch information
guregu committed Aug 9, 2020
2 parents 671c980 + df27f39 commit 3f0d72d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,14 @@ func main() {
// put item
w := widget{UserID: 613, Time: time.Now(), Msg: "hello"}
err := table.Put(w).Run()


// update item field
w.Msg = "hello again"
m, err := dynamo.MarshalItem(w)
err = table.Update("UserID", m["UserID"]).
Set("Msg", m["Msg"]).
Run()

// get the same item
var result widget
err = table.Get("UserID", w.UserID).
Expand Down

0 comments on commit 3f0d72d

Please sign in to comment.