Remove$

Remove$ removes data from a JSON document using a JSON pointer.

Syntax

 RETURN_VALUE = JSON_OBJECT.Remove$(EXPRESSION)

Examples

# Let's remove a member from a JSON document:
Funprog Remove_Member()
	 Local Clbfile SRCJSON
	 SRCJSON = '{"foo": "bar", "bar": "abc"}'
        Local Instance Obj using Object
        ParseInstance Obj with SRCJSON
        Local Boolean R1, R2
        R1 = OBJ.Remove$("/foo")
	 Local Clbfile MYCLB
        R2 = OBJ.Get$("", MYCLB)
        FreeGroup OBJ
End MYCLB -> Returns {"baz": "abc"}

Description

Remove$ removes the key and its value from a JSON document using the JSON pointer syntax.

The result of this function has the boolean type.

Return values

Value Explanation
0 Operation succeeded.
-6 The name of the variable does not exist in the JSON document.
-26 Invalid JSON document or unable to remove.
-70 Invalid argument type.

See also

Add$
Contains$
Get$
Parse Instance
Replace$
Select$