example from http://jgrep.org/#howto fails
See comments starting with '==>':
In-document comparison
If a document contains an array, the '[' and ']' symbols can be used to define a comparison where statements are checked for truth on a per element basis which will then be combined. Consider:
[foo.bar1=1 and foo.bar2=2]
on:
[
{
"foo": [
{
"bar1":1
},
{
"bar2":2
}
],
},
{
"foo": [
{
"bar1":0
},
{
"bar2":0
}
]
}
]
==> invalid JSON!
will return:
[
{
"foo": [
{
"bar1": 1
},
{
"bar2": 2
}
]
}
]
==> query applied to corrected JSON (',' after "foo" elem in first obj deleted) returns nothing; but querying with "foo.bar1=1 and foo.bar2=2" works. jgrep-1.3.1 (installed by gem), ruby 1.8.7 (2010-08-16 patchlevel 302) [x86_64-linux]
Thanks, its been fixed.
You have not fixed the query: [foo.bar1=1 and foo.bar2=2] does not work, but foo.bar1=1 and foo.bar2=2 does.
Thanks, going to rewrite that section to make the example a bit more clear.