treedb_delete_instance()

treedb_delete_instance()#

treedb_delete_instance() deletes a specific instance of a node in the TreeDB, identified by its primary and secondary keys. If links exist and the force option is not set, the deletion will fail.

Prototype

int treedb_delete_instance(
    json_t      *tranger,
    json_t      *node,       // owned, pure node
    const char  *pkey2_name,
    json_t      *jn_options  // bool "force"
);

Parameters

Key

Type

Description

tranger

json_t *

Pointer to the tranger database instance.

node

json_t *

Owned JSON object representing the node to be deleted.

pkey2_name

const char *

Name of the secondary key used to identify the instance.

jn_options

json_t *

JSON object containing options, including the force flag to override link constraints.


Return Value

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

Notes

If links exist and force is not set in jn_options, treedb_delete_instance() will fail.

Prototype

// Not applicable in JS

Prototype

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