gpt4 book ai didi

javascript - 没有元数据的 RestHeart 响应

转载 作者:行者123 更新时间:2023-11-28 17:10:55 26 4
gpt4 key购买 nike

当我查询集合时,如何在没有元数据的情况下获得 RestHeart 响应? (如“_embedded”、“_id”、“_returned”)示例:

https://restheart.url/test

{
"_embedded": [
{
"_id": "5c530d6381e931ba5992ea35",
"isActive": true,
"age": 35
},
{
"_id": "5c530d63602cca9789a4ddb0",
"isActive": true,
"age": 36
},
{
"_id": "5c530d63275c5a64b643ed4a",
"isActive": true,
"age": 37
},
{
"_id": "5c530d63eddff83681b51ebf",
"isActive": true,
"age": 27
},
{
"_id": "5c530d63d6ed461d02948520",
"isActive": true,
"age": 30
},
{
"_id": "5c530d639ef0e13b0cb6f3d7",
"isActive": true,
"age": 24
}
],
"_id": "test",
"_returned": 6
}

最佳答案

答案是使用查询字符串参数“np”。文档:https://restheart.org/learn/representation-format/

https://restheart.url/test?np

[
{
"_id": "5c530d6381e931ba5992ea35",
"isActive": true,
"age": 35
},
{
"_id": "5c530d63602cca9789a4ddb0",
"isActive": true,
"age": 36
},
{
"_id": "5c530d63275c5a64b643ed4a",
"isActive": true,
"age": 37
},
{
"_id": "5c530d63eddff83681b51ebf",
"isActive": true,
"age": 27
}
]

关于javascript - 没有元数据的 RestHeart 响应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54463496/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com