如何解决此异常:“选择获取ALL_ATTRIBUTES时无法指定AttributesToGet”?

时间:2018-01-03 12:21:51

标签: amazon-dynamodb

当我尝试扫描dynamoDb表并使用AWS页面中的以下示例代码返回特定列时:

PS C:\Users\Hugo\Desktop\The store\web2\store\functions> npm install braintree
functions@ C:\Users\Hugo\Desktop\The store\web2\store\functions
+-- braintree@2.4.0
`-- UNMET PEER DEPENDENCY firebase-admin@5.4.3
  +-- UNMET PEER DEPENDENCY  extraneous error: ENOENT: no such file or directory, open 'C:\Users\Hugo\Desktop\The store\web2\store\functions\node_modules\firebase-admin\node_modules\tslint\package.json
  `-- UNMET PEER DEPENDENCY  extraneous error: ENOENT: no such file or directory, open 'C:\Users\Hugo\Desktop\The store\web2\store\functions\node_modules\firebase-admin\node_modules\typescript\package.json

npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\Hugo\Desktop\The store\web2\store\functions\node_modules\firebase-admin\node_modules\tslint\package.json'
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\Hugo\Desktop\The store\web2\store\functions\node_modules\firebase-admin\node_modules\typescript\package.json'
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\Hugo\Desktop\The store\web2\store\functions\node_modules\firebase-admin\node_modules\tslint\node_modules\findup-sync\package.json'
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\Hugo\Desktop\The store\web2\store\functions\node_modules\firebase-admin\node_modules\tslint\node_modules\diff\package.json'
npm WARN gulp-tslint@6.1.3 requires a peer of tslint@^3.7.3 || 3.7.0-dev.5 || >=3.8.0-dev || >=3.9.0-dev || >=3.10.0-dev || >=3.11.0-dev || >=3.12.0-dev || >=3.13.0-dev || >=3.14.0-dev || >=3.15.0-dev || >=3.16.0-dev || >= 4.0.0-dev but none was installed.
npm WARN gulp-typescript@3.2.3 requires a peer of typescript@~2.0.3 || >=2.0.0-dev || >=2.1.0-dev || >=2.2.0-dev || >=2.3.0-dev || >=2.4.0-dev || >=2.5.0-dev || >=2.6.0-dev || >=2.7.0-dev but none was installed.
npm WARN firebase-functions@0.7.5 requires a peer of firebase-admin@~5.5.0 but none was installed.

我遇到以下异常:

  

消息:Amazon.DynamoDBv2.AmazonDynamoDBException:选择获取ALL_ATTRIBUTES时无法指定AttributesToGet   ---- Amazon.Runtime.Internal.HttpErrorResponseException:抛出了类型'Amazon.Runtime.Internal.HttpErrorResponseException'的异常。

我该如何解决?

1 个答案:

答案 0 :(得分:2)

我不得不补充道:

  string tableName = "Thread";
  Table ThreadTable = Table.LoadTable(client, tableName);

  ScanFilter scanFilter = new ScanFilter();
  scanFilter.AddCondition("ForumId", ScanOperator.Equal, forumId);
  scanFilter.AddCondition("Tags", ScanOperator.Contains, "sortkey");

  ScanOperationConfig config = new ScanOperationConfig()
  {
    AttributesToGet = new List<string> { "Subject", "Message" } ,
    Filter = scanFilter
  };

  Search search = ThreadTable.Scan(config); 

到ScanOperationConfig

像这样:

Select = SelectValues.SpecificAttributes