diff --git a/cts.json b/cts.json index 34bad52..11af641 100644 --- a/cts.json +++ b/cts.json @@ -2397,6 +2397,32 @@ } ] }, + { + "name": "filter, equals, special nothing", + "selector": "$.values[?length(@.a) == value($..c)]", + "document": { + "c": "cd", + "values": [ + { + "a": "ab" + }, + { + "c": "d" + }, + { + "a": null + } + ] + }, + "result": [ + { + "c": "d" + }, + { + "a": null + } + ] + }, { "name": "index selector, first element", "selector": "$[0]", @@ -4110,6 +4136,26 @@ } ] }, + { + "name": "functions, length, arg is special nothing", + "selector": "$[?length(value(@.a))>0]", + "document": [ + { + "a": "ab" + }, + { + "c": "d" + }, + { + "a": null + } + ], + "result": [ + { + "a": "ab" + } + ] + }, { "name": "functions, match, found match", "selector": "$[?match(@.a, 'a.*')]", diff --git a/tests/filter.json b/tests/filter.json index c42160a..519bf21 100644 --- a/tests/filter.json +++ b/tests/filter.json @@ -770,6 +770,22 @@ "result": [ {"a": 0.011, "d": "e"} ] + }, + { + "name": "equals, special nothing", + "selector" : "$.values[?length(@.a) == value($..c)]", + "document" : { + "c": "cd", + "values": [ + {"a": "ab"}, + {"c": "d"}, + {"a": null} + ] + }, + "result": [ + {"c": "d"}, + {"a": null} + ] } ] } diff --git a/tests/functions/length.json b/tests/functions/length.json index 7213298..9382c2e 100644 --- a/tests/functions/length.json +++ b/tests/functions/length.json @@ -82,6 +82,18 @@ "result": [ {"a": "ab"} ] + }, + { + "name": "arg is special nothing", + "selector" : "$[?length(value(@.a))>0]", + "document" : [ + {"a": "ab"}, + {"c": "d"}, + {"a": null} + ], + "result": [ + {"a": "ab"} + ] } ] }