From 70e232bd059f9f9a3a03f3a5d31ec8d77e571568 Mon Sep 17 00:00:00 2001 From: Devendra Gera Date: Tue, 1 Apr 2014 14:38:47 +0200 Subject: 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. --- jsonpath_rw/jsonpath.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- cgit v1.2.1