Table of Contents

Class Expression

Namespace
Amazon.DynamoDBv2.DocumentModel
Assembly
AWSSDK.DynamoDBv2.dll

Expressions are used for conditional deletes and filtering for query and scan operations.

public class Expression
Inheritance
Expression
Inherited Members

Constructors

Expression()

public Expression()

Properties

ExpressionAttributeNames

Gets and sets the property ExpressionAttributeNames. This collection contains attribute names from the item that should be substituted in the expression when it is evaluated. For example the expression "#C < #U" will expect the attribute names to be added to this collection.

expression.ExpressionAttributeNames["#C"] = "CriticRating"
expression.ExpressionAttributeNames["#U"] = "UserRating"
public Dictionary<string, string> ExpressionAttributeNames { get; set; }

Property Value

Dictionary<string, string>

ExpressionAttributeValues

Gets and sets the property ExpressionAttributeValues. This collection contains the values to be substituted in the expression. For example the expression "Price > :price" will contain one entry in this collection a key of ":price".

DynamoDBEntry contains many common implicit cast operations so assignment can be done with the basic .NET types. In the price example shown above the value to be used for the expression can be provided using the following code snippet:

expression.ExpressionAttributeValues[":price"] = 3.99;
public Dictionary<string, DynamoDBEntry> ExpressionAttributeValues { get; set; }

Property Value

Dictionary<string, DynamoDBEntry>

ExpressionStatement

Gets and sets the property ExpressionStatement. "Price > :price" is an example expression statement. :price is a variable which gets its value from the ExpressionAttributeValues collection. If this is used for deletes then it prevents the delete from happening if the Price attribute on the item is less then the passed in price. For query and scan it will only return back items where the Price attribute is greater then passed in price.

public string ExpressionStatement { get; set; }

Property Value

string