Skip to content
This repository has been archived by the owner on Oct 14, 2020. It is now read-only.

[?(@.key == null)] don't work #31

Open
4n70w4 opened this issue Jun 18, 2019 · 4 comments
Open

[?(@.key == null)] don't work #31

4n70w4 opened this issue Jun 18, 2019 · 4 comments

Comments

@4n70w4
Copy link

4n70w4 commented Jun 18, 2019

I want filter all items where not exists some key. In https://jsonpath.com/ this is works.
But via FlowCommunications/JSONPath this don't work (((

Do I need to use other syntax or is it not implemented?

@4n70w4
Copy link
Author

4n70w4 commented Jun 18, 2019

Workaround:

Index: vendor/flow/jsonpath/src/Flow/JSONPath/Filters/QueryMatchFilter.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- vendor/flow/jsonpath/src/Flow/JSONPath/Filters/QueryMatchFilter.php	(date 1560860453013)
+++ vendor/flow/jsonpath/src/Flow/JSONPath/Filters/QueryMatchFilter.php	(date 1560860453013)
@@ -67,6 +67,10 @@
                 if ($operator == "<" && $value1 < $comparisonValue) {
                     $return[] = $value;
                 }
+            } else {
+                if($comparisonValue == null) {
+                    $return[] = $value;
+                }
             }
         }

4n70w4 added a commit to 4n70w4/JSONPath that referenced this issue Jun 18, 2019
4n70w4 added a commit to 4n70w4/JSONPath that referenced this issue Jun 18, 2019
@4n70w4
Copy link
Author

4n70w4 commented Jun 18, 2019

#32

4n70w4 added a commit to 4n70w4/JSONPath that referenced this issue Aug 5, 2019
4n70w4 added a commit to 4n70w4/JSONPath that referenced this issue Aug 5, 2019
@4n70w4
Copy link
Author

4n70w4 commented May 29, 2020

up!

@martinssipenko
Copy link
Contributor

This project is now marked as abandoned and suggests using softcreatr/jsonpath as a replacement. If you think this issue is still relevant please open a new ticket under the new project.

https://github.com/SoftCreatR/JSONPath

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants