Tag: amazon dynamodb

DynamoDB中使用Swift 3保留的关键字ExpressionAttributeValues

我可以得到一个没有:status:acceptexpression式属性值的响应,但是在使用投影expression式行中的#status时,我得到以下错误(状态是DynamoDB中的保留字,所以我必须添加hashtag那里根据https://stackoverflow.com/a/45952329/5921575 ): Error Domain=com.amazonaws.AWSCognitoIdentityErrorDomain Code=0 "(null)" UserInfo={__type=com.amazon.coral.validate#ValidationException, message=Value provided in ExpressionAttributeValues unused in expressions: keys: {:status}} 这是代码: queryExpression.keyConditionExpression = "#userId= :userId" queryExpression.expressionAttributeNames = ["#userId":"userId", "#status":"status"] queryExpression.expressionAttributeValues = [":userId":userID, ":status":"accept"] queryExpression.projectionExpression = "#status" 我可以去没有“:状态”:“接受”,但我不想得到很多不具有接受价值的项目。 我无法find一个答案在这个链接或任何在stackoverflow: http : //docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.ExpressionAttributeNames.html 谢谢!

无法使用核心数据从DynamoDB中提取相关项目

我有两个实体,两者之间有一对一的关系。 在testing中,我可以创build这两个实体,join并保存它们。 数据按预期显示在DynamoDB中,并显示相应的ID以显示两者是相关的。 然后我试图找回物品。 我对返回的其中一个项目执行获取请求,并且可以成功logging它的标识符。 但是,如果我试图logging相关的实体的标识符,我期望已经隐式获取我得到以下exception: 2013-01-17 15:00:13.936 DJ[10995:c07] DynamoDBResponse.m|-[DynamoDBResponse connectionDidFinishLoading:]|62|Response Body: {"__type":"com.amazon.coral.validate#ValidationException","message":"1 validation error detected: Value null at 'key.hashKeyElement' failed to satisfy constraint: Member must not be null"} 2013-01-17 15:00:13.936 DJ[10995:c07] DynamoDBResponse.m|-[DynamoDBResponse connectionDidFinishLoading:]|92|Returned CRC32: 650439770, Calculated CRC32: 650439770 2013-01-17 15:00:13.937 DJ[10995:c07] AmazonRequestDelegate.m|-[AmazonRequestDelegate request:didFailWithServiceException:]|74|didFailWithServiceException 2013-01-17 15:00:13.937 DJ[10995:c07] DynamoDBWebServiceClient.m|-[DynamoDBWebServiceClient invoke:rawRequest:unmarshallerDelegate:]|131|Response Status Code : 400 2013-01-17 15:00:13.938 […]

aws dynamodb如何使用批处理对象映射器进入ios

我需要使用ios sdk从dynamodb获得~50个主键。 我能够通过AWSDynamoDB.defaultDynamoDB()。batchGetItem获取项目,但无法弄清楚是否有可能使用对象映射器的响应。 不幸的是,ios中的objectmapper类没有batchGet函数。 据我所知,我不能在这种情况下使用查询。 有没有可能使用对象映射器? 如果不是哪一个更有意义:parsing响应以获取所需的类实例或在每个项目上调用objectMapper.load?

DynamoDB自动增加ID和服务器时间(iOS SDK)

DynammoDB中有一个选项将自动递增的ID作为主键存储在表中吗? 我还需要将服务器时间作为“创build时间”字段(例如,用户创build时间)存储在表中。 但是我没有find从DynamoDB或任何其他AWS服务获取服务器时间的方法。 你们可以帮我吗? 在DyanmoDB表中使用自动递增的ID 将服务器时间存储在“创build于”类似字段的表中。 谢谢。

在objective-c中使用扫描filter的dynamodb scanexpression

AWSDynamoDBObjectMapper *dynamoDBObjectMapper = [AWSDynamoDBObjectMapper defaultDynamoDBObjectMapper]; AWSDynamoDBScanExpression *scanExpression = [AWSDynamoDBScanExpression new]; scanExpression.exclusiveStartKey = nil; scanExpression.limit = @20; [[[dynamoDBObjectMapper scan:[DDBTableRow class] expression:scanExpression] continueWithExecutor:[BFExecutor mainThreadExecutor] withSuccessBlock:^id(BFTask *task) { ……………. 我能够扫描并返回从DynamoDB的特定表中logging的前20个,如上面的一段代码所示。 现在的问题是我想添加一个scanExpression.scanFilter =属性,但我还没有find如何build立的好方向。 我在AWSiOSSDKv2上使用AWSiOSSDKv2 aws sdk for iOS 这是我到目前为止。 它还没有完成: AWSDynamoDBCondition *condition = [AWSDynamoDBCondition new]; AWSDynamoDBAttributeValue *attribute = [AWSDynamoDBAttributeValue new]; attribute.N = @"400"; condition.comparisonOperator = AWSDynamoDBComparisonOperatorEQ; NSDictionary *scanFilter = […]

AWS DynamoDB批量获取请求 – iOS

我可以在AWS dynamoDB中的单个表上执行一个简单的Get请求,但是当我将其扩展到跨多个表的批量请求时,我仍然会收到一个错误 validation error detected: Value null at 'requestItems.rip.member.keys' failed to satisfy constraint 我理解这是值不被正确传递,但我不明白是什么问题与我的代码 //Create Request Values AWSDynamoDBGetItemInput *getItem = [AWSDynamoDBGetItemInput new]; AWSDynamoDBAttributeValue *hashValue = [AWSDynamoDBAttributeValue new]; hashValue.S = @"User Test"; getItem.key = @{@"ripId": hashValue}; //Create Request Values 2 AWSDynamoDBGetItemInput *getItem2 = [AWSDynamoDBGetItemInput new]; AWSDynamoDBAttributeValue *hashValue2 = [AWSDynamoDBAttributeValue new]; hashValue2.S = @"User Test"; getItem2.key = […]

使用AWS Cognito Developer Identities从我的ios应用程序获取对DynamoDB的完全访问权限

我已经实施了AWS Lambdafunction,并使用网关返回填充数据: var param = { IdentityPoolId: "actualIdentityPoolId", Logins: {} // To have provider name in a variable }; param.Logins["com.testing.userLogin"] = userId; cognitoidentity.getOpenIdTokenForDeveloperIdentity(param, function(err, data) { if (err) return fn(err); // an error occurred else fn(null, data.IdentityId, data.Token); // successful response }); 所以身份标识和令牌被发送回ios设备。 在我的设备中,我尝试连接到AWS DynamoDB表,但访问被拒绝。 我如何使用identityId和令牌访问表? 我在IAM中为Unauth设置了angular色,拒绝Dydnamo和Auth,通过它的策略访问表。 我试图执行身份validation使用: http : //docs.aws.amazon.com/cognito/latest/developerguide/authentication-flow.html 我看到有两个基本和增强的stream程。 该文档说,大多数用户将使用增强stream,并实现GetCredentialForIdentity。 这是如何实现在我的IOS代码,以便我可以将我的angular色从unauth切换到身份validation,并可以访问dynamodb? 这个访问会持续多久? […]