User guide
In the preceding example, the ExpressionAttributeNames property specifies the placeholder #title
to represent the Title attribute.The ExpressionAttributeValues property specifies the placeholder
:product to represent the value 18-Bicycle 301.The ConditionExpression property specifies
that #title (Title) must equal :product (18-Bicycle 301).
Additional Resources
For additonal information and code examples, see:
• DynamoDB Series - Expressions
• Accessing Item Attributes with Projection Expressions
• Using Placeholders for Attribute Names and Values
• Specifying Conditions with Condition Expressions
• Modifying Items and Attributes with Update Expressions
• Working with Items Using the AWS SDK for .NET Low-Level API
• Querying Tables Using the AWS SDK for .NET Low-Level API
• Scanning Tables Using the AWS SDK for .NET Low-Level API
• Working with Local Secondary Indexes Using the AWS SDK for .NET Low-Level API
• Working with Global Secondary Indexes Using the AWS SDK for .NET Low-Level API
JSON Support in Amazon DynamoDB with the
AWS SDK for .NET
The AWS SDK for .NET supports JSON data when working with Amazon DynamoDB. This enables you
to more easily get JSON-formatted data from, and insert JSON documents into, DynamoDB tables.
Topics
• Get Data from a DynamoDB Table in JSON Format (p. 63)
• Insert JSON Format Data into a DynamoDB Table (p. 64)
• DynamoDB Data Type Conversions to JSON (p. 64)
• Additional Resources (p. 65)
Get Data from a DynamoDB Table in JSON Format
The following example shows how to get data from a DynamoDB table in JSON format:
// using Amazon.DynamoDBv2;
// using Amazon.DynamoDBv2.DocumentModel;
var client = new AmazonDynamoDBClient();
var table = Table.LoadTable(client, "AnimalsInventory");
var item = table.GetItem(3, "Horse");
var jsonText = item.ToJson();
Console.Write(jsonText);
// Output:
// {"Name":"Shadow","Type":"Horse","Id":3}
var jsonPrettyText = item.ToJsonPretty();
Version v2.0.0
63
AWS SDK for .NET Developer Guide
JSON Support in Amazon DynamoDB