Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

example from http://jgrep.org/#howto fails #12

Open
hartrock opened this issue Jan 24, 2012 · 3 comments
Open

example from http://jgrep.org/#howto fails #12

hartrock opened this issue Jan 24, 2012 · 3 comments

Comments

@hartrock
Copy link

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]

@ploubser
Copy link
Owner

Thanks, its been fixed.

@hartrock
Copy link
Author

hartrock commented Feb 2, 2012

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.

@ploubser ploubser reopened this Feb 2, 2012
@ploubser
Copy link
Owner

ploubser commented Feb 2, 2012

Thanks, going to rewrite that section to make the example a bit more clear.

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

No branches or pull requests

2 participants