【发布时间】:2021-06-28 05:22:30
【问题描述】:
所以我有这个 json,我想重组它,到目前为止它在一个数组中。现在我想根据供应商对其进行排序。 现在的结构是 键1 键2 关键3
键1 键2 关键3
{
"id": "1335735520073232385",
"created_at": "2020-12-07 05:28:59 IST",
"username": "kristinaforest",
"tweet": "@iamsandyhall It’s the look of surprise on her face and the vulnerability on his ????"
"vendor": "null"
}
{
"id": "1335735456223399937",
"created_at": "2020-12-07 05:28:44 IST",
"username": "openbugbounty",
"tweet": "@lyrsense please notify your IT security team about a security vulnerability OBB-1583432 on your website "
"vendor": "openbugbounty"
}
{
"id": "1335735446496817152",
"created_at": "2020-12-07 05:28:41 IST",
"username": "openbugbounty",
"tweet": "@arstechnica please notify your IT security team about a security vulnerability OBB-1583440 on your website "
"vendor": "openbugbounty"
}
{
"id": "1335735260957564929",
"created_at": "2020-12-07 05:27:57 IST",
"username": "tpwk_falls",
"tweet": "2 years into a song of vulnerability - a catchy melody embedded with honest lyrics opening up about a difficult time. Thank u for sharing with us @zaynmalik I’m so proud of how far you’ve come and continue to go. Forever supporting ur journey #2yearsofgoodyears PROUD OF ZAYN "
"vendor": "zayn malik"
}
如何将其重组为
[
{
"vendor": "openbugbounty",
"tweets": [
{
"id": "1335735260957564929",
"created_at": "2020-12-07 05:27:57 IST",
"username": "tpwk_falls",
"tweet": "2 years into a song of vulnerability - a catchy melody embedded with
honest lyrics opening up about a difficult time. Thank u for sharing with us
@zaynmalik I’m so proud of how far you’ve come and continue to go. Forever
supporting ur journey #2yearsofgoodyears PROUD OF ZAYN"
},
{
"id": "1335735260957564929",
"created_at": "2020-12-07 05:27:57 IST",
"username": "tpwk_falls",
"tweet": "2 years into a song of vulnerability - a catchy melody embedded with
honest lyrics opening up about a difficult time. Thank u for sharing with us
@zaynmalik I’m so proud of how far you’ve come and continue to go. Forever
supporting ur journey #2yearsofgoodyears PROUD OF ZAYN "
}
]
},
.....
【问题讨论】:
-
您的输入不是有效的 JSON。请提供正确的示例输入。