// Table Batch shows how to iterate over several items with different keys
// In this example, the range key is considered the same, but it could be different as well
Table Batch shows how to iterate over several items with different keys
In this example, the range key is considered the same, but it could be different as well
// Table Batch shows how to iterate over several items with different keys // In this example the range key is considered the same but it could be different as well
func ExampleTable_Batch_getkeys() {
	db := dynamo.New(session.New(), &aws.Config{Region: aws.String("region")})
	dynaTable := db.Table("table")
	var wordKeys []dynamo.Keyed
	words := []string{"a", "b", "c"}
	for word := range words {
		wordKeys = append(wordKeys, dynamo.Keys{word, "range key"})
	}
	iterator := dynaTable.Batch("pk", "sk").Get(wordKeys...).Iter()
	var value yourType
	for iterator.Next(&value) {
		fmt.Println(value)
	}
	if err := iterator.Err(); err != nil {
		fmt.Println(err)
	}
}
func ExampleTable_Batch_getkeys ( ) { db := dynamo . New ( session . New ( ) , & aws . Config { Region : aws . String ( " " ) } ) dynaTable := db . Table ( " " ) var wordKeys [ ] dynamo . Keyed words := [ ] string { " " , " " , " " } for word := range words { wordKeys = append ( wordKeys , dynamo . Keys { word , " " } ) } iterator := dynaTable . Batch ( " " , " " ) . Get ( wordKeys ... ) . Iter ( ) var value yourType for iterator . Next ( & value ) { fmt . Println ( value ) } if err := iterator . Err ( ) ; err != nil { fmt . Println ( err ) } }
Table Batch shows how to iterate over several items with different keys
In this example, the range key is considered the same, but it could be different as well
Table Batch shows how to iterate over several items with different keys In this example the range key is considered the same but it could be different as well
// db table setup // prepare the request with they key pairs // here "pk", "sk" are the names of the hash and range key fields in the DynamoDB table