treedb_parent_refs()
#
Retrieves a list of parent references for a given node using a specified foreign key. The references are formatted according to the provided options.
Prototype
json_t *treedb_parent_refs(
json_t *tranger,
const char *fkey,
json_t *node, // NOT owned, pure node
json_t *jn_options // owned, fkey options
);
Parameters
Key |
Type |
Description |
---|---|---|
|
|
A reference to the tranger database instance. |
|
|
The foreign key field used to retrieve parent references. |
|
|
The node whose parent references are to be retrieved. This parameter is not owned by the function. |
|
|
Options for formatting the returned references. This parameter is owned by the function. |
Return Value
A JSON array containing the parent references. The caller must decrement the reference count when done using the returned value.
Notes
The function supports multiple formatting options for the returned references, including full references, only IDs, and list dictionaries.
Prototype
// Not applicable in JS
Prototype
# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples