Skip to content

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

@hartrock

Description

@hartrock

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]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions