treedb_update_node()

treedb_update_node()#

treedb_update_node() updates an existing node with the provided fields from kw, without modifying foreign keys (fkeys) or hook fields.

Prototype

json_t *treedb_update_node(
    json_t *tranger,
    json_t *node,   // NOT owned, pure node.
    json_t *kw,     // owned
    BOOL save
);

Parameters

Key

Type

Description

tranger

json_t *

Pointer to the tranger database instance.

node

json_t *

Pointer to the existing node to be updated. This parameter is not owned by the function.

kw

json_t *

JSON object containing the fields to update. This parameter is owned by the function.

save

BOOL

If TRUE, the updated node is saved to the database.


Return Value

Returns a pointer to the updated node. The returned node is not owned by the caller.

Notes

Foreign keys (fkeys) and hook fields are not updated by treedb_update_node(). The returned node must not be modified or freed by the caller.

Prototype

// Not applicable in JS

Prototype

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