From af48f8955c9db1ddbac241f43a023d0fe41a8b32 Mon Sep 17 00:00:00 2001 From: James Prior Date: Mon, 11 Mar 2024 10:20:25 +0000 Subject: [PATCH] Cover existence tests in logical expressions --- tests/filter.json | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/filter.json b/tests/filter.json index 9491103..9edeb4d 100644 --- a/tests/filter.json +++ b/tests/filter.json @@ -407,6 +407,23 @@ {"a":"c", "d": "f"} ] }, + { + "name": "exists and exists, data false", + "selector" : "$[?@.a&&@.b]", + "document" : [{"a": false, "b": false}, {"b": false}, {"c": false}], + "result": [ + {"a": false, "b": false} + ] + }, + { + "name": "exists or exists, data false", + "selector" : "$[?@.a||@.b]", + "document" : [{"a": false, "b": false}, {"b": false}, {"c": false}], + "result": [ + {"a": false, "b": false}, + {"b": false} + ] + }, { "name": "and", "selector" : "$[?@.a>0&&@.a<10]",