eclipse-agail / agile-data

data service for agile
Eclipse Public License 2.0
0 stars 0 forks source link

Parse queries #26

Closed craigmulligan closed 6 years ago

craigmulligan commented 7 years ago

Currently we are just passing the URL query straight to mongo .find which obviously doesn't work, so we could use a parsing lib.

Couple to choose from: https://www.npmjs.com/package/mongo-querystring https://www.npmjs.com/package/query-to-mongo

craigmulligan commented 7 years ago

cc @Exulansis

kdo-sw commented 7 years ago

Does this mean that the current version of the agile-data container currently does not work at all? I am struggling trying to get it work these days - using the agile-sdk...

craigmulligan commented 7 years ago

Hey @kdo-sw 👋 it means that passing a query fails, so GET /api/record?<query> won't work but GET /api/record should work fine.

If this is not the issue you are hitting then please open another issue with some details and I'll look into it! 🙏

Exulansis commented 7 years ago

Out of my experience, what @craig-mulligan mentioned is correct, the data retrieval does work (at least in the agile UI), the query is not taken into consideration (if I am not mistaken, the entire dataset is returned regardless of the query).

craigmulligan commented 6 years ago

You can now pass https://www.npmjs.com/package/mongo-querystring as query parameters. eg /api/record?deviceID=mydevice

craigmulligan commented 6 years ago

Available from v0.0.12.