octoblu / meshblu

Meshblu is a cross-protocol IoT machine-to-machine messaging system.
https://meshblu.readme.io/
MIT License
815 stars 182 forks source link

allow a time range to fetched from /data #33

Closed bassdread closed 10 years ago

bassdread commented 10 years ago

This is my first go at fetching data from /data limited by a timeframe. This adds start and end to to return all data entries matching in between those times.

curl -X GET localhost:3000/data/ef154af1-b5f2-11e3-8af7-f3d4ce6cbe76?token=03ezmz4tx50vvlsormq0jsb8wnv4e7b9\&start=2014-03-27T21:03:00\&finish=2014-03-27T21:03:59\&limit=10

This will return 10 entries from the data collection whos timestamp is between the start and finish times. It also adds "limit" to control the number of entries returned. Setting limit=0 bypasses any limits and returns all the values.

octoblu commented 10 years ago

Sweet pull request! Nice job!!

bassdread commented 10 years ago

I think this approach should work on all the other end points as well :+1: