treedb_list_parents()
#
treedb_list_parents()
returns a list of parent nodes linked to the given node through a specified foreign key (fkey
). The function can return either full parent nodes or collapsed views based on the collapsed_view
parameter.
Prototype
json_t *treedb_list_parents(
json_t *tranger,
const char *fkey,
json_t *node,
BOOL collapsed_view,
json_t *jn_options
);
Parameters
Key |
Type |
Description |
---|---|---|
|
|
A reference to the tranger database instance. |
|
|
The foreign key field used to identify parent nodes. |
|
|
The node whose parents are to be retrieved. This parameter is not owned by the function. |
|
|
If |
|
|
Options for filtering and formatting the returned parent nodes. This parameter is owned by the function. |
Return Value
A JSON array containing the list of parent nodes. The caller must decrement the reference count of the returned JSON object.
Notes
The function retrieves parent nodes based on the specified fkey
. If collapsed_view
is TRUE
, the function returns a simplified representation of the parent nodes. The jn_options
parameter allows customization of the output format.
Prototype
// Not applicable in JS
Prototype
# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples