Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
Create a JSON Patch from a diff of two json documents.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
JSON | 14.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameter | Description | Example |
---|---|---|
json1 | A JSON text or reference. | |
json2 | A JSON text or reference. |
Returns JSON or error.
Create a patch:
MBS( "JSON.JSONPatch.FromDiff";
"{\"people\":[{\"first\":\"Christian\",\"last\":\"Miller\",\"city\":\"Nickenich\"}]}";
"{\"people\":[{\"first\":\"Peter\",\"city\":\"Nickenich\", \"zip\": 56645 }]}" )
Example result:
[
{
"op": "replace",
"path": "/people/0/first",
"value": "Peter"
},
{
"op": "remove",
"path": "/people/0/last"
},
{
"op": "add",
"path": "/people/0/zip",
"value": 56645
}
]
This function checks for a license.
Created 23th November 2023, last changed 23th November 2023