1
+
1
2
# USAGE
2
3
3
4
## jsonjoin [ OPTIONS] JSON_FILE_1 JSON_FILE_2
@@ -28,14 +29,14 @@ the options chosen.
28
29
person.json containes
29
30
30
31
``` json
31
- {
"name" :
" Doe, Jane" ,
"email" :
" [email protected] " ,
"age" :
42 }
32
+ {
"name" :
" Doe, Jane" ,
"email" :
" [email protected] " ,
"age" :
42 }
32
33
```
33
34
34
35
profile.json containes
35
36
36
37
``` json
37
- {"name" : " Doe, Jane" , "bio" : " World renowned geophysist." ,
38
-
38
+ { "name" : " Doe, Jane" , "bio" : " World renowned geophysist." ,
39
+
39
40
```
40
41
41
42
A simple join of person.json with profile.json
@@ -48,23 +49,23 @@ would yeild
48
49
49
50
``` json
50
51
{
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
+ }
55
56
```
56
57
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).
60
61
61
62
+ -update will add unique key/values from the second object to the first object
62
63
+ -overwrite replace key/values in first object one with second objects'
63
64
64
65
Running
65
66
66
67
``` shell
67
- jsonjoin -update person.json profile.json
68
+ jsonjoin -update person.json profile.json
68
69
```
69
70
70
71
would yield
@@ -77,29 +78,28 @@ would yield
77
78
Running
78
79
79
80
``` shell
80
- jsonjoin -update profile.json person.json
81
+ jsonjoin -update profile.json person.json
81
82
```
82
83
83
84
would yield
84
85
85
86
``` 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
+
89
90
```
90
91
91
92
Running
92
93
93
94
``` shell
94
- jsonjoin -overwrite person.json profile.json
95
+ jsonjoin -overwrite person.json profile.json
95
96
```
96
97
97
98
would yield
98
99
99
100
``` 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." }
102
103
```
103
104
104
-
105
105
jsonjoin v0.0.12
0 commit comments