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 ""

func KeyBeginsWith(keyBuilder KeyBuilder, prefix string) KeyConditionBuilder

KeyBeginsWith returns a KeyConditionBuilder representing the result of the begins_with function in DynamoDB Key Condition Expressions. The resulting KeyConditionBuilder can be used as a part of other Key Condition Expressions.


// keyCondition represents the boolean key condition of whether the value // of the key "foo" is begins with the prefix "bar" keyCondition := expression.KeyBeginsWith(expression.Key("foo"), "bar") // Used in another Key Condition Expression anotherKeyCondition := expression.Key("partitionKey").Equal(expression.Value("aValue")).And(keyCondition)

Expression Equivalent:

expression.KeyBeginsWith(expression.Key("foo"), "bar") // Let :bar be an ExpressionAttributeValue representing the value "bar" "begins_with(foo, :bar)"


KeyBuilder represents either the partition key or the sort key, both of which are top level attributes to some item in DynamoDB. Since KeyBuilder represents an operand, KeyBuilder implements the OperandBuilder interface. Methods and functions in the package take KeyBuilder as an argument and establishes relationships between operands. However, KeyBuilder should only be used to describe Key Condition Expressions. KeyBuilder should only be initialized using the function Key().


// Create a KeyBuilder representing the item key "aKey" keyBuilder := expression.Key("aKey")

Type: string


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

On this page: