ConfD User Community

Differentiating between a newly created presence container vs updating an existing presence container

Hi,

typedef struct confd_tag_value {
struct xml_tag tag;
confd_value_t v;
} confd_tag_value_t;

This struct gets filled as part of a config commit, but here no vars w.r.t to the operation done(i.e create/merge…etc) is being stored.
Is there any way to know what operation has been done during a commit by accessing any of the confd structure/Api ??

The requirement is to distinguish between the newly created node (i.e op = create) vs updating of an existing node (op=merge) during that specific commit cycle.

Thank you in advance.

When you are interested in set of changes done as a part of commit, not in the resulting db state, there is procedure cdb_diff_iterate(...). It requires your implementation of callback method that has parameter identifying type of each change/operation being done -> enum cdb_iter_op.

You can grep ConfD examples set -> there are several instances of cdb_diff_iterate() in various examples.

Thank you for the quick response.
Will check.