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.

KeyConditionBuilder

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

type KeyConditionBuilder struct { }

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

Method

And

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.

Example:

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