<reponame>wegroupwolves/jsondiff<gh_stars>0
import ujson

from jsondiff import diff

# UPDATE
a = {"alpha": 1}
b = {"beta": 2}
output = diff(a, b, syntax='symmetric')
print(ujson.dumps(output))
# > [{"alpha":1},{"beta":2}]

# INSERT
a = {"alpha": 1}
b = {"alpha": 1, "beta": 2}
output = diff(a, b, syntax='symmetric')
print(ujson.dumps(output))
# > {"$insert":{"beta":2}}

# DELETE
a = {"alpha": 1, "beta": 2}
b = {"alpha": 1}
output = diff(a, b, syntax='symmetric')
print(ujson.dumps(output))
# > {"$delete":{"beta":2}}

import ujson

from jsondiff import diff

# UPDATE
a = {"alpha": 1}
b = {"beta": 2}
output = diff(a, b, syntax='symmetric')
print(ujson.dumps(output))
# > [{"alpha":1},{"beta":2}]

# INSERT
a = {"alpha": 1}
b = {"alpha": 1, "beta": 2}
output = diff(a, b, syntax='symmetric')
print(ujson.dumps(output))
# > {"$insert":{"beta":2}}

# DELETE
a = {"alpha": 1, "beta": 2}
b = {"alpha": 1}
output = diff(a, b, syntax='symmetric')
print(ujson.dumps(output))
# > {"$delete":{"beta":2}}
# UPDATE # > [{"alpha":1},{"beta":2}] # INSERT # > {"$insert":{"beta":2}} # DELETE # > {"$delete":{"beta":2}}