本文介紹了在objective-c中帶有掃描過濾器的dynamodb scanexpression的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!
問題描述
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 的特定表中記錄的前 20 個(gè),如上面的一段代碼所示.
I am able to scan through and return the first 20 recorded from a specific table from my DynamoDB as shows on a piece of code above.
現(xiàn)在的問題是我想添加一個(gè) scanExpression.scanFilter =
屬性,但我還沒有找到關(guān)于如何構(gòu)建它的任何好的方向.我在 xcode6
The question now is I want to add a scanExpression.scanFilter =
property but I haven't find any good direction on how to build that. I am using AWSiOSSDKv2
aws sdk for iOS on xcode6
這是我目前所擁有的.還沒有完成:
here is what I have so far. It is not complete yet:
AWSDynamoDBCondition *condition = [AWSDynamoDBCondition new];
AWSDynamoDBAttributeValue *attribute = [AWSDynamoDBAttributeValue new];
attribute.N = @"400";
condition.comparisonOperator = AWSDynamoDBComparisonOperatorEQ;
NSDictionary *scanFilter = @{@"lat":
@{@"AttributeValueList":attribute,
@"ComparisonOperator":@1}
};
scanExpression.scanFilter = scanFilter;
推薦答案
可以如下使用:
AWSDynamoDBCondition *condition = [AWSDynamoDBCondition new];
AWSDynamoDBAttributeValue *attribute = [AWSDynamoDBAttributeValue new];
attribute.N = @"400";
condition.attributeValueList = @[attribute];
condition.comparisonOperator = AWSDynamoDBComparisonOperatorEQ;
scanExpression.scanFilter = @{@"lat": condition};
這篇關(guān)于在objective-c中帶有掃描過濾器的dynamodb scanexpression的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!
【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!