gobj_create_node()
#
Creates a new node in the specified topic. The function gobj_create_node()
allows inserting a new record into a hierarchical data structure managed by the gobj system.
Prototype
json_t *gobj_create_node(
hgobj gobj,
const char *topic_name,
json_t *kw,
json_t *jn_options,
hgobj src
);
Parameters
Key |
Type |
Description |
---|---|---|
|
|
The gobj instance managing the hierarchical data structure. |
|
|
The name of the topic where the node will be created. |
|
|
A JSON object containing the attributes of the new node. This parameter is owned by the function. |
|
|
A JSON object specifying options such as foreign key and hook configurations. This parameter is owned by the function. |
|
|
The source gobj that initiated the node creation request. |
Return Value
Returns a JSON object representing the newly created node. If the operation fails, returns NULL.
Notes
The function gobj_create_node()
requires that the gobj instance supports the mt_create_node
method. If the method is not defined, an error is logged, and the function returns NULL.
Prototype
// Not applicable in JS
Prototype
# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples