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 Set(name NameBuilder, operandBuilder OperandBuilder) UpdateBuilder

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


// update represents the set operation to set the item attribute // "itemToSet" to the value "setValue" if the item attribute does not // exist yet. (conditional write) update := expression.Set(expression.Name("itemToSet"), expression.IfNotExists(expression.Name("itemToSet"), expression.Value("setValue"))) // Adding more update methods anotherUpdate := update.Remove(expression.Name("someName")) // Creating a Builder builder := Update(update)

Expression Equivalent:

expression.Set(expression.Name("itemToSet"), expression.IfNotExists(expression.Name("itemToSet"), expression.Value("setValue"))) // Let :val be an ExpressionAttributeValue representing the value // "setValue" "SET itemToSet = :val"


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


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

OperandBuilder represents the idea of Operand which are building blocks to DynamoDB Expressions. Package methods and functions can establish relationships between operands, representing DynamoDB Expressions. The method BuildOperand() is called recursively when the Build() method on the type Builder is called. BuildOperand() should never be called externally. OperandBuilder and BuildOperand() are exported to allow package functions to take an interface as an argument.


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:

On this page: