From d18851defd3bf34cc37cc0b604c4ff6330a9667f Mon Sep 17 00:00:00 2001 From: nate Date: Thu, 9 Apr 2026 22:17:44 +0400 Subject: [PATCH] update: document nested queries --- apps/web/src/views/docs.ejs | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/apps/web/src/views/docs.ejs b/apps/web/src/views/docs.ejs index ea4df5a..134e485 100644 --- a/apps/web/src/views/docs.ejs +++ b/apps/web/src/views/docs.ejs @@ -500,6 +500,21 @@ Content-Type: application/json // $not - invert a condition { "$not": { "status": 500 } } +

These nest freely. You can put $or inside $and, $and inside $or, or go as deep as you want:

+
+
json
+
{
+  "$and": [
+    { "status": 200 },
+    {
+      "$or": [
+        { "$json": { "$.region": { "$eq": "us" } } },
+        { "$json": { "$.region": { "$eq": "eu" } } }
+      ]
+    }
+  ]
+}
+
@@ -586,6 +601,27 @@ Content-Type: application/json { "$json": { "$.db.connections": { "$lt": 100 } } } ] } + +

Nested logic

+

$and and $or nest freely inside each other, as deep as you need.

+
json
+
{
+  "$and": [
+    { "status": { "$lt": 400 } },
+    {
+      "$or": [
+        { "$json": { "$.env": { "$eq": "production" } } },
+        { "$json": { "$.env": { "$eq": "staging" } } }
+      ]
+    },
+    {
+      "$or": [
+        { "$responseTime": { "$lt": 2000 } },
+        { "$json": { "$.cache": { "$eq": "hit" } } }
+      ]
+    }
+  ]
+}