treedb_delete_node()

treedb_delete_node()#

The treedb_delete_node() function deletes a node from the tree database. If the node has existing links, the deletion will fail unless the ‘force’ option is enabled.

Prototype

int treedb_delete_node(
    json_t *tranger,
    json_t *node,       // owned, pure node
    json_t *jn_options  // bool "force"
);

Parameters

Key

Type

Description

tranger

json_t *

A reference to the tranger database instance.

node

json_t *

The node to be deleted. This parameter is owned and must be a pure node.

jn_options

json_t *

A JSON object containing options for deletion. The ‘force’ boolean option determines whether to forcibly delete linked nodes.


Return Value

Returns 0 on success, or a negative error code if the deletion fails.

Notes

If the node has existing links and ‘force’ is not enabled, treedb_delete_node() will fail.

Prototype

// Not applicable in JS

Prototype

# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples