Closed fdrsuisse closed 6 years ago
No, filter qparam does not apply to GET /db requests
@fdrsuisse what do you want to actually achieve?
We would like to filter collections using a suffix such as "AirQualityObserved". This suffix is contained in many "idCollections" and it gives the type of a collection
"http://10.1.17.113:8080/browser/#/sth_carouge_copy?filter={'_id':{'$regex':'.*AirQualityObserved$'}} This one should filter by suffix "AirQualityObserved"
@fdrsuisse does that work with a direct MongoDB query, I mean without RESTHeart involved? I never tried.
Hi, we have a DB named "sth_carouge_copy". When we query it (http://10.1.17.113:8080/browser/#/sth_carouge_copy) it returns a list of collections:
{ "_id": "sth_carouge_copy", "_size": 1480, "_total_pages": 15, "_returned": 100, "_type": "DB", "_embedded": { "rh:coll": [ { "_id": "sthxffffx002fairno2xffffForonxffffNO2xffffAirQualityObserved", "_type": "COLLECTION", "_links": { "self": { "href": "/sth_carouge_copy/sthxffffx002fairno2xffffForonxffffNO2xffffAirQualityObserved" } } }, { "_id": "sthxffffx002fairno2xffffForonxffffNO2xffffAirQualityObserved.aggr", "_type": "COLLECTION", "_links": { "self": { "href": "/sth_carouge_copy/sthxffffx002fairno2xffffForonxffffNO2xffffAirQualityObserved.aggr" } } },
We tried the following queries:
"http://10.1.17.113:8080/browser/#/sth_carouge_copy?filter={'_id':{'$regex':'.*AirQualityObserved$'}} This one should filter by suffix "AirQualityObserved"
"http://10.1.17.113:8080/browser/#/sth_carouge_copy?where={'_id':'sthxffffx002fairno2xffffForonxffffNO2xffffAirQualityObserved'}"
We read your documentation and you proposed to make filters using \/\?filter=.... to filter documents in collections. Is there a way to filter collection directly in db?
Best Regards,
Francesco