From 93c1c752a631c70470767a3bf16e3edb6d0b4046 Mon Sep 17 00:00:00 2001 From: Jeny Sadadia Date: Tue, 26 Nov 2024 11:27:42 +0530 Subject: [PATCH] doc/api-details: document date range queries Describe API support for querying the same field with multiple operators e.g. date range queries. Signed-off-by: Jeny Sadadia --- doc/api-details.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/doc/api-details.md b/doc/api-details.md index 2d429609..e9b8d6c0 100644 --- a/doc/api-details.md +++ b/doc/api-details.md @@ -371,6 +371,16 @@ $ curl 'http://localhost:8001/latest/nodes?kind=kbuild&name__re=x86' returns all Kbuild nodes with the string "x86" in the node name. +API also supports multiple operator queries for the same field name. +For example, date range queries can be triggered as below: + +``` +$ curl 'https://localhost:8001/nodes?created__gt=2024-02-26T13:21:55.301000&created__lt=2024-11-01&kind=checkout' +``` +The above query will return all the checkout nodes in the specific +date range provided, i.e., nodes created between `2024-02-26T13:21:55.301000` and `2024-11-01` date-time range. + + Nodes with `null` fields can also be retrieved using the endpoint. For example, the below command will get all the nodes with `parent` field set to `null`: