API Reference

PREVIEW DOCUMENTATION - This is a preview of a new format for the AWS SDK for Go API Reference documentation. For the current AWS SDK for Go API Reference, see

We welcome your feedback on this new version of the documentation. Send your comments to


import ""

type KeyConditionBuilder struct { }

KeyConditionBuilder represents Key Condition Expressions in DynamoDB. KeyConditionBuilders are the building blocks of Expressions. More Information at:



func (kcb KeyConditionBuilder) And(right KeyConditionBuilder) KeyConditionBuilder

And returns a KeyConditionBuilder representing the logical AND clause of the two argument KeyConditionBuilders. The resulting KeyConditionBuilder can be used as an argument to the WithKeyCondition() method for the Builder struct.


// keyCondition represents the key condition where the partition key // "TeamName" is equal to value "Wildcats" and sort key "Number" is equal // to value 1 keyCondition := expression.Key("TeamName").Equal(expression.Value("Wildcats")).And(expression.Key("Number").Equal(expression.Value(1))) // Used to make an Builder builder := expression.NewBuilder().WithKeyCondition(keyCondition)

Expression Equivalent:

expression.Key("TeamName").Equal(expression.Value("Wildcats")).And(expression.Key("Number").Equal(expression.Value(1))) // Let #NUMBER, :teamName, and :one be ExpressionAttributeName and // ExpressionAttributeValues representing the item attribute "Number", // the value "Wildcats", and the value 1 "(TeamName = :teamName) AND (#NUMBER = :one)"

On this page: