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

How to pick up specific values from array of objects into target array of objects? #343

Closed
manmohantarle opened this issue Dec 21, 2023 · 2 comments

Comments

@manmohantarle
Copy link

manmohantarle commented Dec 21, 2023

Hello @tidwall

I want to get values for some keys from an array of objects and resulting value should also be array of objects with specified keys,

as per given below,
source

[
{
"name": "tom",
"age":37,
"children": ["Sara","Alex","Jack"],
"fav.movie": "Deer Hunter"
},
{
"name": "riddle",
"age":45,
"children": ["Json","James","Jill"],
"fav.movie": "Saw"
}
]

target json

[
{
"name": "tom",
"children": ["Sara","Alex","Jack"]
},
{
"name": "riddle",
"children": ["Json","James","Jill"]
}
]

how can I achieve this?

@volans-
Copy link

volans- commented Dec 21, 2023 via email

@manmohantarle
Copy link
Author

that worked, thank you @volans-

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