jembi / openhim-mediator-mapping

An OpenHIM mediator for mapping incoming content to a different format
https://jembi.github.io/openhim-mediator-mapping/
MIT License
3 stars 7 forks source link

Support more complex readEndpoints queries #76

Closed MattyJ007 closed 3 years ago

MattyJ007 commented 4 years ago

Query parameters passed into the readEndpoints middleware are Strings. This works for simple lookups such as readEndpoints by name=test.

Mongoose supports more complex queries ie: readEndpoints - {createdAt: {$gte: '01-01-2020'}}. The structure of the query requires Objects - therefore to implement this functionality String needs to be parsed into an object.

This logic would probably be implemented here: https://github.com/jembi/openhim-mediator-mapping/blob/master/src/db/services/endpoints/index.js#L14

Similar logic will be needed for the deleteEndpoints API endpoint: https://github.com/jembi/openhim-mediator-mapping/blob/master/src/db/services/endpoints/index.js#L29

MattyJ007 commented 3 years ago

I'm not seeing a use case for this...