gobj_update_node()

gobj_update_node()#

Updates an existing node in the specified topic. If the node does not exist, it can be created based on the provided options. The function allows for automatic linking and volatile node creation.

Prototype

json_t *gobj_update_node(
    hgobj gobj,
    const char *topic_name,
    json_t *kw,
    json_t *jn_options,
    hgobj src
);

Parameters

Key

Type

Description

gobj

hgobj

The GObj instance managing the topic.

topic_name

const char *

The name of the topic where the node resides.

kw

json_t *

A JSON object containing the node data to be updated. The ‘id’ and primary key fields are used to locate the node.

jn_options

json_t *

A JSON object specifying update options such as ‘create’, ‘autolink’, and ‘volatil’.

src

hgobj

The source GObj initiating the update request.


Return Value

Returns a JSON object representing the updated node. If the update fails, NULL is returned.

Notes

If the GObj does not implement mt_update_node, an error is logged and NULL is returned. The function ensures that the GObj is not destroyed before proceeding.

Prototype

// Not applicable in JS

Prototype

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