DynamoDB支持JSON文件 [英] DynamoDB Support for JSON Documents

查看:903
本文介绍了DynamoDB支持JSON文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

AWS DynamoDB每JSON文件近期发布的支持://aws.amazon.com/blogs/aws/dynamodb-update-json-and-more/

AWS DynamoDB recently released support for JSON documents per: http://aws.amazon.com/blogs/aws/dynamodb-update-json-and-more/

问题:

1)如何使用这个,如果我想提出一个请求,直接向服务?难道我只是M值设置为整个JSON对象?

1) How can I use this if I am making a request directly to the service? Do I just set the M value to the entire json object?

2)能指标包括在JSON文件?将DynamoDB能算出这个?

2) Can indexes be included in the JSON document? Will DynamoDB be able to figure this out?

推荐答案

由于记录在你纳入你的问题的链接,对JSON的支持是内置到许多AWS的SDK,而不是在DynamoDB完全实现。使用DynamoDB的新的地图列表类型,例如,一个JSON结构映射到DynamoDB类型和结构在predictable方式。所以,不,你不会设置 M 值对整个JSON对象(除非这就是你想要的最终结构)。

As documented in the link you included in your question, the support for JSON is built into many of the AWS SDKs rather than being entirely implemented in DynamoDB. Using DynamoDB's new Map and List types for example, a JSON structure is mapped to DynamoDB types and structures in a predictable way. So, no, you would not set an M value to the entire JSON object (unless that's the final structure you wanted).

指标继续使用标准的访问模式作为记录这里可为例。

Indexes continue to be available using the standard access patterns as documented here for example.

您需要使用的软件开发工具包中的一个或提供自己的服务层到一个JSON文件映射到DynamoDB项目。

You would need to use one of the SDKs or provide your own service layer to map a JSON document to a DynamoDB item.

目前( 2014年十一月的),在AWS-SDK对JavaScript(包括NodeJS)不具有内置的JSON数据的支持。但是,它是可以通过AWS-Labs的项目这里。你会看到在该文件的客户端code重视的事件,使所有的数据都可以被格式化(从JSON为本地DynamoDB)code:

Currently (November 2014), the AWS-SDK for JavaScript (which includes NodeJS) does not have built-in support for JSON data. However, it is available through an AWS-Labs project here. You'll see in that code that the document client code attaches to an event so that all of the data can be formatted (from JSON to native DynamoDB):

request.on("extractData", f.formatOutput);

其中, F 是他们的 DynamoDBFormatter

Where f is an instance of their DynamoDBFormatter.

这篇关于DynamoDB支持JSON文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆