Is there any easy way to put an item in Amazon DynamoDB with AWS SDK CPP using as input the item in JSON format? Something like
Aws::DynamoDB::Model::PutItemRequest request;
request.SetTableName(table);
request.FunctionThatSetsAllAttributesParsingAJsonString(json_string);
Or is it always necessary to set each attribute and its type?
Aws::DynamoDB::Model::PutItemRequest request;
request.SetTableName(table);
Aws::DynamoDB::Model::AttributeValue val1;
val1.SetS(str);
request.AddItem(key, val1);
Aws::DynamoDB::Model::AttributeValue val2;
...
If the JSON object follows Amazon DynamoDB JSON format, you can easily convert it into an Aws::Map<Aws::String, Aws::DynamoDB::Model::AttributeValue> object. For instance, for a Jsoncpp Json::Value object:
Then, to put the Aws::Map<Aws::String, Aws::DynamoDB::Model::AttributeValue> object: