Skip to content

$..[?(@.name=='is_literate')] expression works completely fine on https://jsonpath.com/ but it throw an error while using this expression at jsonpath-ng #200

@lalitmahato

Description

@lalitmahato

Hello everyone,
I am facing an issue with phasing data. My expression looks like $..[?(@.name=='is_literate')] it throws error. Also, I tried $[?(@.name=='is_literate')] this time, this does not throw any error, but I did not get the expected value. Which is given as follows. I tried it at https://jsonpath.com/, it works fine with $..[?(@.name=='is_literate')] expression.

Note: I have the name of the label, but I don't have label. I need a label based on the name value.

[
  {
    "control": {
      "appearance": "quick"
    },
    "children": [
      {
        "name": "is_literate_1",
        "label": "साक्षर"
      },
      {
        "name": "is_literate_0",
        "label": "निरक्षर"
      }
    ],
    "name": "is_literate",
    "label": "${full_name}: साक्षर कि निरक्षर ?",
    "bind": {
      "required": "true"
    },
    "type": "select one"
  }
]

I am attaching the JSON file for reference. I would appreciate it if someone could resolve this issue. Thank You.
Json File

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