我是新手DynamoDB
,我想用它来存储我将与 S3 对象匹配的键字符串。这是我上传字符串的代码:
AmazonCredentials *amazonCreds = [[AmazonCredentials alloc] initWithAccessKey:ACCESS_KEY_ID withSecretKey: SECRET_KEY];
AmazonDynamoDBClient *dClient = [[AmazonDynamoDBClient alloc] initWithCredentials: amazonCreds];
[dClient setEndpoint: [AmazonEndpoints s3Endpoint:AP_SOUTHEAST_1 secure: YES]];
NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:
[[DynamoDBAttributeValue alloc] initWithS: req.key],
@"QuoteKey",
nil];
DynamoDBPutItemRequest *dReq = [[DynamoDBPutItemRequest alloc] initWithTableName:@"TestQuotesTable" andItem: [dict mutableCopy]];
DynamoDBPutItemResponse *dRes = [dClient putItem: dReq];
但是当我去控制台并进入表格时,该项目没有上传....我的代码有问题吗?当我第一次创建表时DynamoDB
,默认键/属性名称是“QuoteKey”,所以一切都应该没问题。
我的代码有什么问题吗?谢谢