Closed fdrsuisse closed 6 years ago
The query must be passed with the filter query parameter, ie /sth_carouge?filter={...}
Many thanks for your suggestion but the query :
"/sth_carouge?filter={'underscoreid':'sth/airno2_Foron_NO2_AirQualityObserved'}&hal=f "
returns to me the same collection of the query: "/sthcarouge?hal=f"
During the copy and past of the JSON the underscore "underscore" in the "underscore_id " and "sthunderscore" fields disappeared and I added 'underscore' to show you...
{ "_id": "sth_underscore/airno2_Foron_NO2_AirQualityObserved", "_type": "COLLECTION", "_links": { "self": { "href": "/sth_carouge/sth/airno2_Foron_NO2_AirQualityObserved" }
Probably I have to escape the underscore in "sth_/airno2".... Thanks in advance
/sth_carouge
is a db, correct?
the filter
qparam applies to collection and document URIs (see http://restheart.org/learn/resource-uri/), for instance
GET /db/coll?filter={"a":1}
From your response, I see that you have a collection whose name contains / sth_underscore/airno2_Foron_NO2_AirQualityObserved
This is a problem, since it is not possible to distinguish the slash in the collection name from the slash used in the URI:
GET /sth_carouge/th_underscore/airno2_Foron_NO2_AirQualityObserved
will look for a document with _id airno2_Foron_NO2_AirQualityObserved
in the th_underscore
collection. see https://github.com/SoftInstigate/restheart/issues/177
only solution: don't use / in collection names
Hi "/sth_carouge" is the DB name. The collection contains a "/" in its name "sth_underscore/airno2_Foron_NO2_AirQualityObserved" I can't delete the / in the collection name, I am only an end user. If do I use another Rest tool such as Python EVE do you think will I have the same problem ? Many thanks for your answer
Good Morning, I have to query a MongoDB via a get to the following JSON
My current query: /sth_carouge?{'id':'sth/airno2_Foron_NO2_AirQualityObserved'}&hal=f doesn't work on the JSON:
{ "_id": "sth_carouge", "_size": 1480, "_total_pages": 370, "_returned": 4, "_type": "DB", "_embedded": { "rh:coll": [ { "id": "sth/airno2_Foron_NO2_AirQualityObserved", "_type": "COLLECTION", "_links": { "self": { "href": "/sthcarouge/sth/airno2_Foron_NO2_AirQualityObserved" } } }, { "id": "sth/airno2_Foron_NO2_AirQualityObserved.aggr", "_type": "COLLECTION", "_links": { "self": { "href": "/sthcarouge/sth/airno2_Foron_NO2_AirQualityObserved.aggr" } } }, { "id": "sth/airno2_Meyrin_NO2_AirQualityObserved", "_type": "COLLECTION", "_links": { "self": { "href": "/sthcarouge/sth/airno2_Meyrin_NO2_AirQualityObserved" } } }, { "id": "sth/airno2_Meyrin_NO2_AirQualityObserved.aggr", "_type": "COLLECTION", "_links": { "self": { "href": "/sthcarouge/sth/airno2_Meyrin_NO2_AirQualityObserved.aggr" } } } ] }, "_links": { "self": { "href": "/sth_carouge?pagesize=4&hal=f" }, "first": { "href": "/sth_carouge?pagesize=4&hal=f" }, "last": { "href": "/sth_carouge?page=370&pagesize=4&hal=f" }, "next": { "href": "/sth_carouge?page=2&pagesize=4&hal=f" }, "rh:root": { "href": "/" }, "rh:db": { "href": "/{dbname}", "templated": true }, "rh:coll": { "href": "/sth_carouge/{collname}", "templated": true }, "rh:bucket": { "href": "/sth_carouge/{bucketname}.files", "templated": true }, "rh:paging": { "href": "/sth_carouge{?page}{&pagesize}", "templated": true }, "curies": [ { "href": "http://restheart.org/curies/3.0/{rel}.html", "templated": true, "name": "rh" }, { "href": "http://restheart.org/curies/3.0/{rel}.html", "templated": true, "name": "rh" } ] } } Any help will be appreciated Best Regards, Francesco