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.

NewBuilder

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

func NewBuilder() Builder

NewBuilder returns an empty Builder struct. Methods such as WithProjection() and WithCondition() can add different kinds of DynamoDB Expressions to the Builder. The method Build() creates an Expression struct with the specified types of DynamoDB Expressions.

Example:

keyCond := expression.Key("someKey").Equal(expression.Value("someValue")) proj := expression.NamesList(expression.Name("aName"), expression.Name("anotherName"), expression.Name("oneOtherName")) builder := expression.NewBuilder().WithKeyCondition(keyCond).WithProjection(proj)

Builder

Builder represents the struct that builds the Expression struct. Methods such as WithProjection() and WithCondition() can add different kinds of DynamoDB Expressions to the Builder. The method Build() creates an Expression struct with the specified types of DynamoDB Expressions.

Example:

keyCond := expression.Key("someKey").Equal(expression.Value("someValue")) proj := expression.NamesList(expression.Name("aName"), expression.Name("anotherName"), expression.Name("oneOtherName")) builder := expression.NewBuilder().WithKeyCondition(keyCond).WithProjection(proj) expr := builder.Build() queryInput := dynamodb.QueryInput{ KeyConditionExpression: expr.KeyCondition(), ProjectionExpression: expr.Projection(), ExpressionAttributeNames: expr.Names(), ExpressionAttributeValues: expr.Values(), TableName: aws.String("SomeTable"), }

On this page: