Closed Qahraman closed 8 years ago
you can control the properties to return via keys query parameter
http://restheart.org/curies/1.0/keys.html
however the HAL properties (starting with _) cannot be filtered out. there is an improvement in the roadmap to allow to filter out HAL properties selectively
have a look here https://softinstigate.atlassian.net/browse/RH-109
OK.Thank you very much
For your information, the improvement is on the way, you can find it in the latest commit.
basically, if you add the hal=c (c stands for Compact) query parameter, the HAL representation will not include some information.
In your case, it will be:
{
"_links": {
"curies":[],
"self": {"href":"/firstProject/N_SENSOR_ARCHIVE/55e6b2fcb03e1b93c4602fd8"}
},
_created_on":"2015-09-02T08:27:40Z",
_last_updated_on":"2015-09-02T08:27:40Z",
"_type":"DOCUMENT",
"SENSOR_ID":1439,
"RECIEVED_DATE":{"$date":1423906060362},"
_id":{"$oid":"55e6b2fcb03e1b93c4602fd8"}
}
Thanks @ujibang
My request returns as follow : {"_embedded":{},"_links":{"curies":[{"name":"rh","href":"http://www.restheart.org/docs/v0.10/#api-doc-{rel}"}],"self":{"href":"/firstProject/N_SENSOR_ARCHIVE/55e6b2fcb03e1b93c4602fd8"},"rh:coll":{"href":"/firstProject"}},"_created_on":"2015-09-02T08:27:40Z","_type":"DOCUMENT","SENSOR_ID":1439,"RECIEVED_DATE":{"$date":1423906060362},"_id":{"$oid":"55e6b2fcb03e1b93c4602fd8"}}
I want to return from their only "SENSOR_ID" and "RECIEVED_DATE" fields.How can I disable others?