Skip to content

JSON manipulation #70

@bartbutenaers

Description

@bartbutenaers

Dear,

I was wondering if there is any way to use Jsonata for changing Json data, or returning a transformed version of the JSON data (containing the changes).

For example assume following input:

{
    "TOPIC1": {
        "last_value": "old value"
    },
    "TOPIC2": {
        "last_value": "old value"
    }
}

That needs to be transformed to following output (based on some Jsonata expression):

{
    "TOPIC1": {
        "last_value": "old value"
    },
    "TOPIC2": {
        "last_value": "new value"
    }
}

Since Jsonata is a query and transformation language (and not a manipulation language), I assume it is not possible... I have been debugging the entire expression evaluation, but couldn't find anything relevant.

But perhaps there is a workaround e.g. using a user defined function (that logs everything from the original data, except from the changes )?

Thanks in advance for your time !!!
Bart Butenaers

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions