Remove Metadata From Result
For compare, merge, and graft operations, DeltaJSON adds the optional dx_deltaJSON_metadata
object to the final result. The metadata shows basic information about the operation and its parameters. See more: The DeltaJSON Delta Format | Metadata.
The “metadata” parameter can be used to remove the dx_deltaJSON_metadata
object from the result as per requirement.
This parameter is set to true
by default - i.e. the dx_deltaJSON_metadata
object is present in the result. You can control this behavior by specifying a metadata
parameter and setting its value to either true
(add metadata) or false
(remove metadata from the result).
Example JSON request
{
"a": {
"type": "file",
"uri": "inA.json"
},
"b": {
"type": "file",
"uri": "inB.json"
},
"metadata": false
}
The metadata
parameter, like all the others DeltaJSON parameters, can be specified as a part of structural, either JSON
or XML
, or multipart/form-data
request.
Example Delta result (metadata=true)
{
"dx_deltaJSON": {
"dx_data_sets": "A!=B",
"dx_deltaJSON_type": "diff",
"dx_deltaJSON_metadata": {
"operation": {
"type": "compare",
"input-format": "multi_part_strings",
"output-format": "JSON"
},
"parameters": {
"wordByWord": false,
"arrayAlignment": "orderless"
}
},
"dx_deltaJSON_delta": {
...
}
}
}
Example Delta result (metadata=false)
{
"dx_deltaJSON": {
"dx_data_sets": "A!=B",
"dx_deltaJSON_type": "diff",
"dx_deltaJSON_delta": {
...
}
}
}