treedb_parent_refs()

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

tranger

json_t *

A reference to the tranger database instance.

fkey

const char *

The foreign key field used to retrieve parent references.

node

json_t *

The node whose parent references are to be retrieved. This parameter is not owned by the function.

jn_options

json_t *

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