Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

DynamoDBScaningusingC

I want to list all items in Dynamodb using C ++.

There was documentation on "GetItem", but I needed a list of all the items.

I learned about "Scan" and coded similar to the "GetItem" example: https://docs.aws.amazon.com/sdk-for-cpp/v1/developer-guide/examples-dynamodb-items.html

The "GetItem" example succeeded, But it is not easy to code with "Scan".

I do not know how to code it for statement in "Scan".

There is no function available in "itemEntrys". Am I doing it wrong?

Aws::DynamoDB::DynamoDBClient dynamoDbClient(credentials, clientConfig);

Aws::DynamoDB::Model::ScanRequest scanRequest;
scanRequest.SetTableName("smsReport");

auto scanItemOutcome = dynamoDbClient.Scan(scanRequest);
Aws::DynamoDB::Model::ScanResult scanresult = scanItemOutcome.GetResult();
Aws::Vector<Aws::Map<Aws::String, Aws::DynamoDB::Model::AttributeValue>> 
returnedScanItem = scanresult.GetItems();
            for (auto& itemEntrys : returnedScanItem)
            {   
                //this
            }

Comments