| ADD |
empty or {} |
empty |
document |
| json |
empty |
| jsonpath |
empty |
| input |
"color": "yellow" |
| result |
{ "color": "yellow" } |
| json |
empty |
| jsonpath |
empty |
| input |
{ "color": "yellow"} |
| result |
{ "color": "yellow" } |
|
| ADD |
document |
empty |
document |
| json |
{ "shape": "square" } |
| jsonpath |
empty |
| input |
"color": "yellow" |
| result |
{"shape":"square", "color":"yellow"} |
| json |
{ "COLOR": "YELLOW" } |
| jsonpath |
empty |
| input |
{"color":"yellow"} |
| result |
{"color":"yellow","COLOR":"YELLOW"} |
|
| REPLACE |
document |
empty |
document |
| json |
{"departments":[
{"group":"Technology","employees":["John","James","Jack"]},
{"group":"Accounting","employees":["Adam","Abbey","Apollo"]}
]}
|
| jsonpath |
empty |
| input |
{"department":null} |
| result |
{"department":null} |
|
| REPLACE |
document |
empty |
null |
| json |
{"departments":[
{"group":"Technology","employees":["John","James","Jack"]},
{"group":"Accounting","employees":["Adam","Abbey","Apollo"]}
]}
|
| jsonpath |
empty |
| input |
null |
| result |
null |
|
| ADD |
document |
node (existing) |
document |
| json |
{"color":{"name":"YELLOW","hue":{"red":255}}} |
| jsonpath |
color.hue |
| input |
{"green":255,"blue":0} |
| result |
{"color":{
"name":"YELLOW",
"hue":{"red":255,"green":255,"blue":0}}
}
|
|
| REPLACE |
document |
node (existing) |
document (same name as existing node) |
| json |
{"color":{"brightness":0.254,"name":"YELLOW","hue":[255,0,0]}} |
| jsonpath |
color |
| input |
{"hue":[255,255,0]} |
| result |
{"color":{
"brightness":0.254,
"name":"YELLOW",
"hue":[255,255,0]}
}
|
|
| ADD |
document |
array (existing) |
document |
| json |
{"departments":[
{"employees":["John","James","Jack"],"group":"Technology"},
{"employees":["Adam","Abbey","Apollo"],"group":"Accounting"}
]}
|
| jsonpath |
departments |
| input |
{"group":"Support","employees":["Peter","Paul","Pippy"]} |
| result |
{"departments":[
{"employees":["John","James","Jack"],"group":"Technology"},
{"employees":["Adam","Abbey","Apollo"],"group":"Accounting"},
{"employees":["Peter","Paul","Pippy"],"group":"Support"}
]}
|
|
| ADD |
document |
array (existing) |
array |
| json |
{"color":{"brightness":0.254,"name":"YELLOW","hue":[255,0,0]}} |
| jsonpath |
color.hue |
| input |
[1,2,3] |
| result |
{"color":{
"brightness":0.254,
"name":"YELLOW",
"hue":[255,0,0,1,2,3]}
}
|
| json |
{"departments":[
{"group":"Technology","employees":["John","James","Jack"]},
{"group":"Accounting","employees":["Adam","Abbey","Apollo"]}
]}
|
| jsonpath |
departments[1].employees |
| input |
["Peter","Paul","Pippy"] |
| result |
{"departments":[
{"group":"Technology","employees":["John","James","Jack"]},
{"group":"Accounting","employees":["Adam","Abbey","Apollo","Peter","Paul","Pippy"]}
]}
|
|
| ADD |
document |
array (empty, existing) |
document |
| json |
{"departments":[
{"employees":["John","James","Jack"],"group":"Technology"},
{"employees":["Adam","Abbey","Apollo"],"group":"Accounting"},
{"favorites":[]}
]}
|
| jsonpath |
departments[2].favorites |
| input |
{"color":"pink","numbers":[3,2,1.5]} |
| result |
{"departments":[
{"employees":["John","James","Jack"],"group":"Technology"},
{"employees":["Adam","Abbey","Apollo"],"group":"Accounting"},
{"favorites":[{"color":"pink","numbers":[3,2,1.5]}]}
]}
|
|
| ADD |
document |
array index (existing) |
simple value |
| json |
{"departments":[
{"group":"Technology","employees":["John","James","Jack"]},
{"group":"Accounting","employees":["Adam","Abbey","Apollo"]}
]}
|
| jsonpath |
departments[1].employees[3] |
| input |
1353.234 |
| result |
{"departments":[
{"group":"Technology","employees":["John","James","Jack"]},
{"group":"Accounting","employees":["Adam","Abbey","Apollo",1353.234]}
]}
|
|
| REPLACE |
document |
array index (existing) |
document |
| json |
{"departments":[
{"employees":["John","James","Jack"],"group":"Technology"},
{"employees":["Adam","Abbey","Apollo"],"group":"Accounting"},
{"favorites":[]}
]}
|
| jsonpath |
departments[2] |
| input |
{"favorites":{"color":"black","numbers":[42,39,7.14]}} |
| result |
{"departments":[
{"employees":["John","James","Jack"],"group":"Technology"},
{"employees":["Adam","Abbey","Apollo"],"group":"Accounting"},
{"favorites":{"color":"black","numbers":[42,39,7.14]}}
]}
|
|
| REPLACE |
document |
array index (existing) |
array |
| json |
{"color":{"brightness":0.254,"name":"YELLOW","hue":[255,0,0]}} |
| jsonpath |
color.hue[1] |
| input |
[255,0] |
| result |
{"color":{
"brightness":0.254,
"name":"YELLOW",
"hue":[255,[255,0],0]}
}
|
|
| REPLACE |
document |
array index (existing) |
document |
| json |
{"departments":[
{"group":"Technology","employees":["John","James","Jack"]},
{"group":"Accounting","employees":["Adam","Abbey","Apollo"]}
]}
|
| jsonpath |
departments[0] |
| input |
{"employees":null,"group":null} |
| result |
{"departments":[
{"group":null,"employees":null},
{"group":"Accounting","employees":["Adam","Abbey","Apollo"]}
]}
|
|
| REPLACE |
document |
simple value (existing) |
document |
| json |
{"color":"YELLOW"} |
| jsonpath |
color |
| input |
{"red":250,"green":250,"blue":230} |
| result |
{"color":{"red":250,"green":250,"blue":230}} |
|
| ADD |
array |
empty |
document |
| json |
[255,2,3] |
| jsonpath |
empty |
| input |
{"extra":[213,94]} |
| result |
[255,2,3,{"extra":[213,94]}] |
|
| ADD |
array |
empty |
array |
| json |
[255,2,3] |
| jsonpath |
empty |
| input |
[254,54] |
| result |
[255,2,3,254,54] |
|
| ADD |
array |
array |
list |
| json |
{"color":["YELLOW"]} |
| jsonpath |
color |
| input |
true,"chicken",59.2 |
| result |
{"color":["YELLOW",true,"chicken",59.2]} |
|
| ADD |
array |
array index (non-existing) |
list |
| json |
{"color":["YELLOW"]} |
| jsonpath |
color[1] |
| input |
true,"chicken",59.2 |
| result |
{"color":["YELLOW",[true,"chicken",59.2]]} |
|
| ADD |
array |
array index (non-existing) |
simple value |
| json |
{"color":["YELLOW"]} |
| jsonpath |
color[1] |
| input |
pink |
| result |
{"color":["YELLOW","pink"]} |
|
| none |
document |
node (non-existing) |
array |
| json |
{"departments":[
{"group":"Technology","employees":["John","James","Jack"]},
{"group":"Accounting","employees":["Adam","Abbey","Apollo"]}
]}
|
| jsonpath |
departments[1].years |
| input |
[16,5,2.7] |
| result |
{"departments":[
{"group":"Technology","employees":["John","James","Jack"]},
{"group":"Accounting","employees":["Adam","Abbey","Apollo"]}
]}
|
|
| none |
array |
node (non-existing) |
array |
| json |
[255,2,3] |
| jsonpath |
a |
| input |
[213,94] |
| result |
[255,2,3] |
|