Skip to content

Commit

Permalink
Merge pull request #86 from toritori0318/add-docs-for-index
Browse files Browse the repository at this point in the history
add docs for index
  • Loading branch information
guregu authored Mar 19, 2019
2 parents 7d38b07 + 834e14d commit 8e451fd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ type widget struct {
Friends []string `dynamo:",set"` // Sets
Set map[string]struct{} `dynamo:",set"` // Map sets, too!
SecretKey string `dynamo:"-"` // Ignored
Category string `dynamo:"Category"` // Global Secondary Index
Children []any // Lists
}

Expand All @@ -48,6 +49,11 @@ func main() {
Filter("'Count' = ? AND $ = ?", w.Count, "Message", w.Msg). // placeholders in expressions
One(&result)

// get by index
err = table.Get("Cateogry", "hoge").
Index("category-index").
One(&result)

// get all items
var results []widget
err = table.Scan().All(&results)
Expand Down

0 comments on commit 8e451fd

Please sign in to comment.