-
Notifications
You must be signed in to change notification settings - Fork 71.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow API to search things better #504
Conversation
This allows a query such as this to search for events of hypoglycemia for example: curl -g localhost:3434 \ /api/v1/entries \ '?find[sgv][$lte]=70&find[sgv][$gte]=20&count=1000 It's possible to construct most mongo queries by url encoding the query string. In this instance, mongo performs poorly when searching for lte/gte for strings. In order for ranged queries to perform properly, the query parameters must be set to integer type. There is a quick and ugly helper to ensure that some sgv queries will be respected as integer searches.
1 similar comment
$ curl -g localhost:3434/api/v1/entries'?find[dateString][$lte]=2015-01-32&find[dateString][$gte]=2015-01-00&count=10000' | wc -l && echo
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 559k 0 559k 0 0 187k 0 --:--:-- 0:00:02 --:--:-- 187k
9813
|
Cool, very useful |
Looks like lots of data is getting filtered out, missing |
and would be nice if |
Queries such as: ?find[type]=mbg will now serve responses with payloads with non-SGV data elements, including mbgs. In fact, the type query above filters to select only mbg records.
I strongly encourage using iso8601 date encoding to make the date filtering features work with ease. |
I agree on date format, I don't think the api really used yet so it's a good fine to change. Maybe add a param to return UTC timestamps? |
Works good should we do something with the date format here (export only) or wait till we do something bigger? |
Lets look at date formatting outside of this, going to merge now |
allow API to search things better
This allows a query such as this to search for events of hypoglycemia for
example:
It's possible to construct most mongo queries by url encoding the query string.
In this instance, mongo performs poorly when searching for lte/gte for strings.
In order for ranged queries to perform properly, the query parameters must be
set to integer type. There is a quick and ugly helper to ensure that some sgv
queries will be respected as integer searches.