Well. I’ve been digging some more, and in the interests of sharing my now working results, here is what I’ve found.
-
There is an outstanding documentation bug reported well over two years ago at https://github.com/kobotoolbox/kobocat/issues/150, such that the operators are actually
$gt
rather thangt$
, etc. -
The
date
field shown in the example is a red-herring. Rather, the field to be compared must exist in the dataset. I’ve been using_submission_time
. -
The query must be URL-encoded. Here is an example that works for me with the
curl
command-line toolcurl -s -G --user "$username:$password" --data-urlencode query='{"_submission_time":{"$gt":"2019-02-27"}}' https://kc.kobotoolbox.org/api/v1/data/12345
The date/time value can be either a date (as in the example here) or a more complete date/time such as
2019-02-17T17:00:00+0000
to indicate 5pm UTC on 17th February 2019.