现在当我规范化这个数组时:
[
{
"teamName":"abc",
"description":"",
"id":"123"
},
{
"teamName":"def",
"description":"",
"id":"456"
}
]
Normalizr输出:
{
"result":[
"123",
"456"
],
"entities":{
"teams":{
"123":{
"teamName":"abc",
"description":"",
"id":"123"
},
"456":{
"teamName":"def",
"description":"",
"id":"456"
}
}
}
}
纯粹通过修改架构,有没有办法输出它?
{
"queries":[
"123",
"456"
],
"teams":{
"123":{
"teamName":"abc",
"description":"",
"id":"123"
},
"456":{
"teamName":"def",
"description":"",
"id":"456"
}
}
}
我知道事后可以很容易地做到这一点,但有没有内置的方法来调整输出的JSON数据的结构?
答案 0 :(得分:0)
Normalizr旨在为所有输出提供标准响应,只有两个顶级键results
和entities
。没有选项来执行您的请求。