diff options
author | Milo Casagrande <milo.casagrande@linaro.org> | 2014-12-19 15:51:02 +0100 |
---|---|---|
committer | Milo Casagrande <milo.casagrande@linaro.org> | 2014-12-19 15:51:02 +0100 |
commit | 61aebdbf29122615cc3fe6bcc6b6fd46aefaf1cd (patch) | |
tree | 10b58e263bfce5f712d3ae9178887905893d3a2d /doc/intro.rst | |
parent | 06b869ec52a081909b9c5ee42c167de86a6f8cda (diff) |
doc: Add definition for ranged searches.
Change-Id: I1be2dfdf51548a5d581184136ea1ad8cac7a3228
Diffstat (limited to 'doc/intro.rst')
-rw-r--r-- | doc/intro.rst | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/doc/intro.rst b/doc/intro.rst index 2b4b3d8..abe36db 100644 --- a/doc/intro.rst +++ b/doc/intro.rst @@ -125,6 +125,41 @@ date at ``23:59 UTC`` to ``00:00 UTC`` of the range date. Internally it will be } } +Ranged Searches +*************** + +With fields of type ``int`` and with date type ones, it is possible to perform ranged +search using the ``gte`` (greater-than-equal) and ``lt`` (less-than) operators. + +The syntax to define a ranged search is as follows: + +:: + + [gte|lt]=field,value + +``field`` and ``value`` are separated by a comma (``,``). + +The following example will search the ``boot`` collection for boot reports whose +``retries`` value is between ``2`` and ``4``: + +.. sourcecode:: http + + GET /boot?gte=retries,2<=retries,5 HTTP/1.1 + +It will be converted as follows: :: + + { + "retries": { + "$gte": 2, + "$lt": 5, + } + } + +The operators can be repeated multiple times. If repeated more than once for +the same field, the last parsed one will be considerd. + +The order in which the arguments are parsed might not be guaranteed. + Authentication and Tokens ------------------------- |