Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

creating nested json #707

Open
yosiasz opened this issue Aug 15, 2024 · 1 comment
Open

creating nested json #707

yosiasz opened this issue Aug 15, 2024 · 1 comment

Comments

@yosiasz
Copy link

yosiasz commented Aug 15, 2024

hello

for the following json

{
"realtime_start": "2024-08-14",
"realtime_end": "2024-08-14",
"date": "2024-02-01",
"value": "311.054"
},
{
"realtime_start": "2024-08-14",
"realtime_end": "2024-08-14",
"date": "2024-03-01",
"value": "312.230"
}

I want to generate

{
	"194701": {
		"date": "1947-01-01",
		"value": "21.48"
	},
	"194701": {
		"date": "1947-01-01",
		"value": "21.48"
	}
}

what would be the jsonata way of doing this please?

@mattbaileyuk
Copy link
Member

The intending mapping is unclear here in your example output. Should date and value come from each of the original objects - but what about the key (which is identical, and so not valid JSON)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants