treedb_create_node()

treedb_create_node()#

Creates a new node in the TreeDB. The node is stored in tranger under the specified treedb_name and topic_name.

Prototype

json_t *treedb_create_node(
    json_t       *tranger,
    const char   *treedb_name,
    const char   *topic_name,
    json_t       *kw // owned
);

Parameters

Key

Type

Description

tranger

json_t *

Pointer to the tranger database instance.

treedb_name

const char *

Name of the TreeDB where the node will be created.

topic_name

const char *

Name of the topic under which the node will be stored.

kw

json_t *

JSON object containing the attributes of the new node. This parameter is owned by the function.


Return Value

Returns a JSON object representing the newly created node. WARNING: The returned object is NOT owned by the caller and must not be modified or freed.

Notes

This function creates a ‘pure node’ without loading hook links. The primary key (pkey) of all topics must be ‘id’, and it must be a string.

Prototype

// Not applicable in JS

Prototype

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