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.

Plus

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

func Plus(leftOperand, rightOperand OperandBuilder) SetValueBuilder

Plus creates a SetValueBuilder to be used in as an argument to Set(). The arguments can either be NameBuilders or ValueBuilders. Plus() only supports DynamoDB Number types, so the ValueBuilder must be a Number and the NameBuilder must specify an item attribute of type Number. More information: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.UpdateExpressions.html#Expressions.UpdateExpressions.SET.IncrementAndDecrement

Example:

// Use Plus() to set the value of the item attribute "someName" to 5 + 10 update, err := expression.Set(expression.Name("someName"), expression.Plus(expression.Value(5), expression.Value(10)))

Expression Equivalent:

expression.Plus(expression.Value(5), expression.Value(10)) // let :five and :ten be ExpressionAttributeValues for the values 5 and // 10 respectively. ":five + :ten"

leftOperand

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.

rightOperand

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.

SetValueBuilder

SetValueBuilder represents the outcome of operator functions supported by the DynamoDB Set operation. The operator functions are the following:

Plus() // Represents the "+" operator Minus() // Represents the "-" operator ListAppend() IfNotExists()

For documentation on the above functions, see: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.UpdateExpressions.html#Expressions.UpdateExpressions.SET Since SetValueBuilder represents an operand, it implements the OperandBuilder interface. SetValueBuilder structs are used as arguments to the Set() function. SetValueBuilders should only initialize a SetValueBuilder using the functions listed above.

On this page: