-
Notifications
You must be signed in to change notification settings - Fork 167
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 merge objects? #69
Comments
Additionally to this, it would be great to be merge into an empty object. So give |
@tidwall this feature would also help me! |
In this case you may want to use the gjson @join modifier object1 := `{ "one": 1 }`
object2 := `{ "two": 2, "three": 3 }`
combined := gjson.Get(`[`+object1+`,`+object2+`]`, `@join`).Raw
println(combined)
// Output: {"one":1,"two":2,"three":3} |
I think it would be better to have a dedicated func for this task. for example: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you for sjson, its great!
Let's say I have:
How do I merge the two to obtain:
{ "one": 1, "two": 2, "three": 3 }
?I've tried:
Apologies if this is already possible. Wasn't obvious to me.
The text was updated successfully, but these errors were encountered: