Questions tagged [jsonata]
JSONata is a JSON query and transformation language.
jsonata
226
questions
0
votes
0
answers
25
views
Unable to load JSONATA into duktape JavaScript engine
I'm trying to use jsonata for python in a Jupyter notebook running in Visual Studio Code. I have installed jsonata via %pip install jsonata, and have imported it via import jsonata. However, when I ...
0
votes
3
answers
47
views
Removing an array object from main Object
I am trying to remove an array object based on value of array object property by using JSONATA transform function but the array object is not getting removed. If pmtDtls.lnAprvlStatus ='D', the object ...
0
votes
1
answer
56
views
Search for an element in a global context messages array in node-red
Context
I defined in the context of my node-red instance a global context variable "devices" with each element defined by the {device_id, agent_id} element pair that it obtains from the ...
0
votes
2
answers
44
views
how to merge children to an array in jsonata
How can I merge the objects from "123" and "Trilby hat"
{
"123": {
"Price": 68.9,
"Qty": 2,
"ProductID": 858383
},
"Trilby hat": ...
0
votes
2
answers
74
views
devide values with JSONata
JSONata is honestly driving me crazy. I asked something similar a couple of weeks ago, but I still don't know what I'm doing so here I am again.
What I'm working with:
[[ {
"time": &...
1
vote
1
answer
43
views
Combine dictionaries with same key using JSONata
I am trying to combine the information from two dictionaries into one. I have a JSON like this:
{
"First": {
"example1": [
{
"key": &...
0
votes
1
answer
37
views
JSONata, error applying expression to arrays of jsons inside multi-level JSON
I used to have an input of the form:
[{
"id": "abc",
"week": "2024-01-01",
"type": "renovation",
"amount": "0"
},...
0
votes
1
answer
52
views
Jsonata Transformation to extract a value and make it a key
Jsonata newbie here. I need help with Jsonata Transformation to extract a value from json element and make it as key .
{
"key-1":[{
"id":"a",
"value":2.3
},{...
0
votes
1
answer
41
views
How to deal with an empty array when filtering?
If I have this input
[
{
"data": 4
},
{
"data": 7
}
]
and the expression $.data[], I get [4, 7].
If the input array is empty instead [], I get no match.
I want an ...
1
vote
2
answers
70
views
Get the top n items in array with JSONata
How can I get the top 5 keys with the highest values from a JSON using JSONata?
Let's say I have something like this. They keys aren't alphabetically ordered, but the values are descending and I want ...
0
votes
1
answer
43
views
How to make JSONata for getting results like
If I have a source like
{
"Data": {
"CREATED": "2022-04-08",
"EDITED": "2023-04-08"
}
}
I want to get an output like
{
&...
0
votes
0
answers
28
views
Jsonata Get path element for each occurrence
My json:
{
"adminShifts": {
"1": [
{
"adminShiftId": 2490609,
"annotation": "",
"dutyID": 64404,
...
0
votes
1
answer
98
views
In JSONata How to print date from todays date+60 calendar days
For eg:
if today's date is 03/39/2024, it should print after 60 days -05/28/2024
Code to get today's date:
$fromMillis($toMillis($now()), '[M01]/[D01]/[Y0001]')
But how to print for 60 calendar ...
1
vote
1
answer
30
views
jsonata merge array with aggreate
with this example https://try.jsonata.org/J_4M9J9JS
from this result
{ "123": [ { "Price": 34.45, "Qty": 2, "ProductID": 858383 }, { "Price": 34.45, &...
0
votes
1
answer
80
views
jsonata expression to append the value
i have a json object as in below
{
"_namespace": "kubernetes",
"api_paths": [
{
"api_action": "post",
"api_path": "...