diff options
author | Devendra Gera <gera@theoldmonk.net> | 2014-04-01 14:38:47 +0200 |
---|---|---|
committer | Devendra Gera <gera@theoldmonk.net> | 2014-04-01 14:38:47 +0200 |
commit | 70e232bd059f9f9a3a03f3a5d31ec8d77e571568 (patch) | |
tree | fab0289881d050c76faf27afb6659332e31111e0 | |
parent | 034b9ec1acb2a1875b5e3a4fe3c937e2237da427 (diff) | |
download | jsonpath-rw-70e232bd059f9f9a3a03f3a5d31ec8d77e571568.tar.gz |
Fix Where to work as advertised
This actually uses the right expression to filter the selected subdata and not just match on the whole data which just determines if there will be any output at all or not.
-rw-r--r-- | jsonpath_rw/jsonpath.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/jsonpath_rw/jsonpath.py b/jsonpath_rw/jsonpath.py index 7e45cb9..2394bd1 100644 --- a/jsonpath_rw/jsonpath.py +++ b/jsonpath_rw/jsonpath.py @@ -272,7 +272,7 @@ class Where(JSONPath): self.right = right def find(self, data): - return [subdata for subdata in self.left.find(data) if self.right.find(data)] + return [subdata for subdata in self.left.find(data) if self.right.find(subdata)] def __str__(self): return '%s where %s' % (self.left, self.right) |