Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to query DynomoDB and return key value pairs as strings
    text
    copied!<p>I'm trying to query a DynamoDB that i have created using code from the Amazon docs with a few simple modifications. I'm trying to take the data i get and write it to a log file as strings. But all i can seem to get is this: </p> <p>2013-02-22 20:21:37.9268|Trace|[System.Collections.Generic.Dictionary<code>2+KeyCollection[System.String,Amazon.DynamoDB.Model.AttributeValue] System.Collections.Generic.Dictionary</code>2+ValueCollection[System.String,Amazon.DynamoDB.Model.AttributeValue]]|</p> <p>I've tried a few different things but all return either the same thing, or something very similar.</p> <p>The code i'm using:</p> <pre><code> private static void GetCallsForRange() { AmazonDynamoDBConfig config = new AmazonDynamoDBConfig(); config.ServiceURL = "http://dynamodb.us-west-2.amazonaws.com"; AmazonDynamoDBClient client = new AmazonDynamoDBClient(config); DateTime startDate = DateTime.Today.AddDays(-21); string start = startDate.ToString("G", DateTimeFormatInfo.InvariantInfo); DateTime endDate = DateTime.Today; string end = endDate.ToString("G", DateTimeFormatInfo.InvariantInfo); QueryRequest request = new QueryRequest { TableName = "Inquiry", HashKeyValue = new AttributeValue { S = "+15555555555" }, RangeKeyCondition = new Condition { ComparisonOperator = "BETWEEN", AttributeValueList = new List&lt;AttributeValue&gt;() { new AttributeValue { S = start }, new AttributeValue { S = end } } } }; QueryResponse response = client.Query(request); QueryResult result = response.QueryResult; foreach (Dictionary&lt;string, AttributeValue&gt; item in response.QueryResult.Items) { string logMsg = String.Format("[{0} {1}]", item.Keys, item.Values); Logging.LogTrace(logMsg); } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload