1+
12# USAGE
23
34## jsonjoin [ OPTIONS] JSON_FILE_1 JSON_FILE_2
@@ -28,14 +29,14 @@ the options chosen.
2829person.json containes
2930
3031``` json
31- {
"name" :
" Doe, Jane" ,
"email" :
" [email protected] " ,
"age" :
42 }
32+ {
"name" :
" Doe, Jane" ,
"email" :
" [email protected] " ,
"age" :
42 }
3233```
3334
3435profile.json containes
3536
3637``` json
37- {"name" : " Doe, Jane" , "bio" : " World renowned geophysist." ,
38- 38+ { "name" : " Doe, Jane" , "bio" : " World renowned geophysist." ,
39+ 3940```
4041
4142A simple join of person.json with profile.json
@@ -48,23 +49,23 @@ would yeild
4849
4950``` json
5051 {
51- "person" :
{ "name" :
" Doe, Jane" ,
"email" :
" [email protected] " ,
"age" :
42 },
52- "profile" : {"name" : " Doe, Jane" , "bio" : " World renowned geophysist." ,
53- 54- }
52+ "person" :
{ "name" :
" Doe, Jane" ,
"email" :
" [email protected] " ,
"age" :
42 },
53+ "profile" : { "name" : " Doe, Jane" , "bio" : " World renowned geophysist." ,
54+ 55+ }
5556```
5657
57- You can modify this behavor with -add or -merge . Both options are
58- order dependant (i.e. not guaranteed to be associative, A add B does
59- not necessarily equal B add A).
58+ You can modify this behavor with -update or -overwrite . Both options are
59+ order dependant (e.g. not associative, A update B does
60+ not necessarily equal B update A).
6061
6162+ -update will add unique key/values from the second object to the first object
6263+ -overwrite replace key/values in first object one with second objects'
6364
6465Running
6566
6667``` shell
67- jsonjoin -update person.json profile.json
68+ jsonjoin -update person.json profile.json
6869```
6970
7071would yield
@@ -77,29 +78,28 @@ would yield
7778Running
7879
7980``` shell
80- jsonjoin -update profile.json person.json
81+ jsonjoin -update profile.json person.json
8182```
8283
8384would yield
8485
8586``` json
86- { "name" : " Doe, Jane" , "age" : 42 ,
87- "bio" : " World renowned geophysist." ,
88- 87+ { "name" : " Doe, Jane" , "age" : 42 ,
88+ "bio" : " World renowned geophysist." ,
89+ 8990```
9091
9192Running
9293
9394``` shell
94- jsonjoin -overwrite person.json profile.json
95+ jsonjoin -overwrite person.json profile.json
9596```
9697
9798would yield
9899
99100``` json
100- {
"name" :
" Doe, Jane" ,
"email" :
" [email protected] " ,
"age" :
42 ,
101- "bio" : " World renowned geophysist." }
101+ {
"name" :
" Doe, Jane" ,
"email" :
" [email protected] " ,
"age" :
42 ,
102+ "bio" : " World renowned geophysist." }
102103```
103104
104-
105105jsonjoin v0.0.12
0 commit comments