Removes the members of an object named key and frees them, keeping the order of the rest. A
key that a document repeated has every copy removed, so json_get finds nothing afterwards.
The result is whether there was anything to remove; anything but an object has nothing.
Signature
json_remove :: (object: *Json_Value, key: string) -> bool
- key
- the member name.
object, _ := from_json(Json_Value, "{\"a\": 1, \"b\": 2}");
assert(json_remove(*object, "a"));
assert(!json_remove(*object, "a"));
assert(json_get(*object, "a") == null && json_count(*object) == 1);
free_json(*object);