我是 JavaScript 新手。我相信这对有经验的人来说很容易。
Amazon AWS SDK for Node.JS 的 SimpleDB getAttributes 函数返回如下数据数组:
my_JSON_object = {"Attributes":[{"Name":"myName","Value":"myValue"},{"Name":"myName","Value":"myValue"},{"Name":"myName","Value":"myValue"},{"Name":"myName","Value":"myValue"},{"Name":"myName","Value":"myValue"},{"Name":"myName","Value":"myValue"},{"Name":"myName","Value":"myValue"},{"Name":"myName","Value":"myValue"},{"Name":"myName","Value":"myValue"}]}
我想将它转换成这样的简单对象:
my_JSON_object = {"Attributes":{"myName":"myValue","myName":"myValue",...}}
这样我就可以使用点语法来访问事物,例如:Attributes.myName 等。
我该如何进行这样的转换?