treedb_list_nodes()
#
treedb_list_nodes()
retrieves a list of nodes from a specified topic in a tree database, optionally filtering the results based on a provided filter and a custom matching function.
Prototype
json_t *treedb_list_nodes(
json_t *tranger,
const char *treedb_name,
const char *topic_name,
json_t *jn_filter, // owned
BOOL (*match_fn) (
json_t *topic_desc, // NOT owned
json_t *node, // NOT owned
json_t *jn_filter // NOT owned
)
);
Parameters
Key |
Type |
Description |
---|---|---|
|
|
A reference to the tranger database instance. |
|
|
The name of the tree database to query. |
|
|
The name of the topic from which to retrieve nodes. |
|
|
A JSON object containing filter criteria for selecting nodes. This parameter is owned by the function. |
|
|
A function pointer to a custom matching function that determines whether a node matches the filter criteria. |
Return Value
Returns a JSON array containing the list of nodes that match the filter criteria. The caller must decrement the reference count of the returned JSON object when done.
Notes
If match_fn
is provided, it is used to further refine the selection of nodes based on custom logic. The returned JSON object must be properly decremented to avoid memory leaks.
Prototype
// Not applicable in JS
Prototype
# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples