简体   繁体   English

AWS DynamoDB扫描输出

[英]AWS DynamoDB Scan output

I'm using the AWS JS SDK for dynamo, and running a scan to get a list of the items in a table. 我正在使用AWS JS SDK进行发电机运行,并运行扫描以获取表格中的项目列表。 The results come back but each value is nested inside a key of the attribute type: 结果返回但每个值都嵌套在属性类型的键中:

For example: 例如:

I would expect image: { thumbnail: ' http://foobar.jpg ' } 我期待图像:{thumbnail:' http://foobar.jpg '}

But I am getting image: { thumbnail: { S: ' http://foobar.jpg ' } } 但我得到了图片:{thumbnail:{S:' http://foobar.jpg '}}

Is there a way to get the SDK to spit out plain values? 有没有办法让SDK吐出简单的值?

我最终使用这个https://github.com/CascadeEnergy/dynamoDb-marshaler不再需要繁琐的键控

不要直接使用DynamoDb扫描,请使用DynamoDb.DocumentClient()来简化结果集并提取字段类型标识符。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM