如何解决如何通过键入localhost访问JSON文件中另一个表中的特定表?
输入async
给了我这个完整的json文件。
localhost:3000
但是当我输入{
"dishes": [{
"id": "0","name": "Uthappizza","image": "images/uthappizza.png","category": "mains","featured": true,"label": "Hot","price": "4.99","description": "A unique combination of Indian Uthappam (pancake) and Italian pizza,topped with Cerignola olives,ripe vine cherry tomatoes,Vidalia onion,Guntur chillies and Buffalo Paneer.","comments": [{
"rating": 5,"comment": "Imagine all the eatables,living in conFusion!","author": "John Lemon","date": "2012-10-16T17:57:28.556094Z"
},{
"rating": 4,"comment": "Sends anyone to heaven,I wish I could get my mother-in-law to eat it!","author": "Paul McVites","date": "2014-09-05T17:57:28.556094Z"
},{
"rating": 3,"comment": "Eat it,just eat it!","author": "Michael Jaikishan","date": "2015-02-13T17:57:28.556094Z"
},"comment": "Ultimate,Reaching for the stars!","author": "Ringo Starry","date": "2013-12-02T17:57:28.556094Z"
},{
"rating": 2,"comment": "It's your birthday,we're gonna party!","author": "25 Cent","date": "2011-12-02T17:57:28.556094Z"
},{
"author": "Aayush","rating": 4,"comment": "This is Great","date": "2020-08-19T10:39:39.720Z"
}
]
}]
}
时,我得到了
localhost:3000/dishes/0
但是现在我只想从{
"id": "0","comments": [
{
"rating": 5,"date": "2012-10-16T17:57:28.556094Z"
},{
"rating": 4,"date": "2014-09-05T17:57:28.556094Z"
},{
"rating": 3,"date": "2015-02-13T17:57:28.556094Z"
},"date": "2013-12-02T17:57:28.556094Z"
},{
"rating": 2,"date": "2011-12-02T17:57:28.556094Z"
},{
"author": "Aayush","date": "2020-08-19T10:39:39.720Z"
}
]
}
的{{1}}中获得comments
。我尝试了dishes
和id: "0"
,但没有得到理想的结果。可以在URL中键入什么以使该表包含在更多表中?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。