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.

Delete

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

func Delete(name NameBuilder, value ValueBuilder) UpdateBuilder

Delete returns an UpdateBuilder representing one Delete operation for DynamoDB Update Expressions. The argument name should specify the item attribute and the argument value should specify the value to be deleted. The resulting UpdateBuilder can be used as an argument to the WithUpdate() method for the Builder struct.

Example:

// update represents the delete operation to delete the string value // "subsetToDelete" from the item attribute "pathToList" update := expression.Delete(expression.Name("pathToList"), expression.Value("subsetToDelete")) // Adding more update methods anotherUpdate := update.Remove(expression.Name("someName")) // Creating a Builder builder := Update(update)

Expression Equivalent:

expression.Delete(expression.Name("pathToList"), expression.Value("subsetToDelete")) // let :del be an ExpressionAttributeValue representing the value // "subsetToDelete" "DELETE pathToList :del"

name

NameBuilder represents a name of a top level item attribute or a nested attribute. Since NameBuilder represents a DynamoDB Operand, it implements the OperandBuilder interface. Methods and functions in the package take NameBuilder as an argument and establishes relationships between operands. NameBuilder should only be initialized using the function Name().

Example:

// Create a NameBuilder representing the item attribute "aName" nameBuilder := expression.Name("aName")
value

ValueBuilder represents an item attribute value operand and implements the OperandBuilder interface. Methods and functions in the package take ValueBuilder as an argument and establishes relationships between operands. ValueBuilder should only be initialized using the function Value().

Example:

// Create a ValueBuilder representing the string "aValue" valueBuilder := expression.Value("aValue")

UpdateBuilder

UpdateBuilder represents Update Expressions in DynamoDB. UpdateBuilders are the building blocks of the Builder struct. Note that there are different update operations in DynamoDB and an UpdateBuilder can represent multiple update operations. More Information at: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.UpdateExpressions.html

On this page: