用 Angularjs 或 Jquery 重构 Json 的最佳方法是什么?
我得到一个具有以下格式的 json
[
{
"address":"balh",
"lat":123,
"long":456
},
{
"address":"balh",
"lat":321,
"long":543
},
{
"address":"balh",
"lat":432,
"long":333
},
{
"address":"balh",
"lat":123,
"long":456
},
{
"address":"balh",
"lat":321,
"long":543
},
{
"address":"balh",
"lat":432,
"long":333
}
]
我需要的格式是将它与以下三个分组..
{
"1":[
{
"address":"balh",
"lat":123,
"long":456
},
{
"address":"balh",
"lat":321,
"long":543
},
{
"address":"balh",
"lat":432,
"long":333
}
],
"2":[
{
"address":"balh",
"lat":123,
"long":456
},
{
"address":"balh",
"lat":321,
"long":543
},
{
"address":"balh",
"lat":432,
"long":333
}
]
}