查询集合时如何在没有元数据的情况下获得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
}
最佳答案
答案是使用QueryString参数“ 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
}
]