我试着查看他们文档的Mozilla JSON stringify页以及这里的SO和谷歌,但没有找到解释。我已经使用JSON.stringify
很多次了,但从来没有遇到过这个结果。
我有一个JSON对象数组:
[
{
"param_2": "Description 1",
"param_0": "Name 1",
"param_1": "VERSION 1"
},
{
"param_2": "Description 2",
"param_0": "Name 2",
"param_1": "VERSION 2"
},
{
"param_2": "Description 3",
"param_0": "Name 3",
"param_1": "VERSION 3"
}
]
它附加到我的$scope
。为了将它们作为一个参数POST
,我使用JSON.stringify()
方法并接收到以下内容:
[
{
"param_2": "Description 1",
"param_0": "Name 1",
"param_1": "VERSION 1",
"$$hashKey": "005"
},
{
"param_2": "Description 2",
"param_0": "Name 2",
"param_1": "VERSION 2",
"$$hashKey": "006"
},
{
"param_2": "Description 3",
"param_0": "Name 3",
"param_1": "VERSION 3",
"$$hashKey": "007"
}
]
我只是好奇$$hashkey
属性到底是什么,因为我期望从stringify
方法(即没有$$hashkey
)中得到更类似于下面的东西:
[
{
"1":{
"param_2": "Description 1",
"param_0": "Name 1",
"param_1": "VERSION 1"
},
"2":{
"param_2": "Description 2",
"param_0": "Name 2",
"param_1": "VERSION 2"
},
"3":{
"param_2": "Description 3",
"param_0": "Name 3",
"param_1": "VERSION 3"
}
}
]
我不确定这是否是一个因素,但我正在使用以下:
我还在服务器端使用了Spring安全性3.0.7。
它没有引起我任何问题,但我想知道$$hashkey
的原因和原因