OverWrite a value with Boolean
using JSON Pointer..
ASTER::ACTION::JSON::Assign a value as Boolean..
The value at the path specified by the JSON Pointer is overwritten with
Boolean
.
-
This overwrite command does not perform type checking in advance.
-
Note that the data type of the value specified by the path is forcibly overwritten with the Boolean type.
Parameter.1
Designation of JSON Pointer.
The following JSON data is currently loaded into memory.
{
"test":true
}
The path specification for Parameter.1 is as follows.
"/test"
Parameter.2
Numeric input,
1
|0
corresponds to True | False.
1
0
Overwrite for a JSON array
The following JSON data is currently loaded into memory.
{
"test":[
false,
false,
false
]
}
Parameter.1 specifies the path with a JSON Pointer, including array elements.
"/test/1"
Parameter.2 specifies the boolean value as a number.
1
If an instruction is given to rewrite the value to true
in Parameter.2, it will be rewritten as follows.
{
"test":[
false,
true,
false
]
}
Boolean-related features
By using the Targeted Path Feature (Targeted JSON Pointer), you can use boolean-specific conditions that perform both type checking and value checking simultaneously. This is effective when executing safe overwrite operations.
--- title: Work Flow of using Targeted JSON Pointer --- flowchart LR B{Set Targeted JSON Pointer} E[Condition: If Type is Boolean And Value is true] F[Condition: If Type is Boolean And Value is false] B -->C[Check Type] C -->E C -->F E --> J[Over Write as Bool : false] F --> K[Over Write as Bool : true]
-
ASTER::JSON::
ACTION
:: Set Targeted JSON Pointer -
ASTER::JSON::
CONDITION
:: if targeted is Type of Boolean and Value is True -
ASTER::JSON::
CONDITION
:: if targeted is Type of Boolean and Value is False
When batch processing value rewriting for JSON data using loops in CF25, it is recommended to use the following Targeted JSON Pointer feature for better processing efficiency by omitting the above type checking.
--- title: Work Flow of using Targeted JSON Pointer for Array --- flowchart LR A{Set Targeted JSON Pointer} C[Run CF25: Fastloop] E[Condition: If Value of /Array/loopindex is 0] F[Condition: If Value of /Array/loopindex is 1] A -->C C -->E C -->F E --> J[Over Write to /Array/loopindex with true] F --> K[Over Write to /Array/loopindex with false]
-
ASTER::JSON::
ACTION
:: Set Targeted JSON Pointer -
ASTER::JSON::
EXPRESSION
:: Targeted JSON Pointer: Get as Numerical value -
ASTER::JSON::
ACTION
:: Targeted JSON Pointer: Over Write to Array Element as Boolean