What would be an example on how to perform a query in AWS DynamoDB using the C++ SDK? I cannot find such an example in TableOperationTest.cpp in "aws-cpp-sdk-dynamodb-integration-tests".
When I use "getItemRequest" to use a hash key to get an item result from DynamoDB, how to can I get the "key value" for the non-hash key?
For example, I have created a dynamo table as follows. "id" is the hash key.
{ "id": "1", "Status": "0", }
getItemRequest.AddKey("id", "1");
getItemRequest.SetTableName("mytablename");
auto getItemOutcome = dynamoDbClient.GetItem(getItemRequest);
GetItemResult result = getItemOutcome.GetResult();
Aws::Map<Aws::String, AttributeValue> returnedItemCollection = result.GetItem();
std::cout << "Status: " << returnedItemCollection["Status"].GetS() << std::endl;
I need to specify the key "Status"
to get attribute value using returnedItemCollection["Status"].GetS()
. How can I know the item has a key "Status"
?