Skip to content

Support for Jolt-like "&" and "@" wildcards/operators for shift #88

Open
@jeffneely

Description

It doesn't seem like Kazaam supports some of the wildcard functionality that Jolt offers in terms of the shift operation...

As an example, here is a Jolt shift spec:

  {
    "operation": "shift",
    "spec": {
      "job": {
        "task": {
          "*": {
            "query": {
              "*": {
                "name": "tasks[&3].queries[&1].query",
                "enabled": "tasks[&3].queries[&1].query_enabled",
                "@(2,name)": "tasks[&3].queries[&1].task_name",
                "@(4,name)": "tasks[&3].queries[&1].job_name"
              }
            }
          }
        }
      }
    }
 }

Specifically:
"&" - references key values captured by a walked wildcard "*" path to get a value
Example:

{
    "foo" : {
        "bar": {
            "baz":  // &0 = baz, &1 = bar, &2 = foo
        }
    }
}

"@" - reference another key by name in a walked wildcard "*" path
Example: "@(3,title)"
"3" means go up the tree 3 levels and then lookup the key "title" and use the value at that key

Any plans to support these?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions