AWS SDK for Go (PILOT)
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 https://docs.aws.amazon.com/sdk-for-go/api/.

We welcome your feedback on this new version of the documentation. Send your comments to aws-sdkdocs-feedback@amazon.com.

KeyBeginsWith

import "github.com/aws/aws-sdk-go/service/dynamodb/expression"

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.

Example:

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

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().

Example:

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

Type: string

KeyConditionBuilder

KeyConditionBuilder represents Key Condition Expressions in DynamoDB. KeyConditionBuilders are the building blocks of Expressions. More Information at: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Query.html#Query.KeyConditionExpressions

On this page: