Skip to content

Implement ability to search for specific keys using dot-style JSON "path" syntax #173

@cohml

Description

@cohml

Say I have the following JSON:

{
  "a": [
    {
      "a": [
        "a"
      ]
    }
  ]
}

If I do /a, I'll get three matches. But what if I'm looking for a specific one? This can get really hairy if the JSON is large and heavily nested.

If I want to specifically search for a.a, it'd be super handy to be able to do that directly. Something like /a.a, but obviously something more robust than basic / search would be required lest the keys themselves actually have . in them.

Currently, AFAIK doing this requires leaving jless and reentering it with a jq pipe e.g., jq 'a.a' < file.json | jless. Kind of a pain, especially if I have multiple things to search for.

Alternatively, if this feature is already implemented, please update the :h docs to reflect this, because I didn't see anything about it.

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