treedb_get_instance()
#
treedb_get_instance()
retrieves a specific node instance from a TreeDB topic using both primary and secondary keys.
Prototype
json_t *treedb_get_instance(
json_t *tranger,
const char *treedb_name,
const char *topic_name,
const char *pkey2_name, // required
const char *id, // primary key
const char *key2 // secondary key
);
Parameters
Key |
Type |
Description |
---|---|---|
|
|
Pointer to the tranger database instance. |
|
|
Name of the TreeDB database. |
|
|
Name of the topic within the TreeDB. |
|
|
Name of the secondary key field (required). |
|
|
Primary key of the node instance. |
|
|
Secondary key of the node instance. |
Return Value
Returns a pointer to a json_t
object representing the requested node instance. The returned object is NOT owned by the caller and must not be modified or freed.
Notes
If the specified instance does not exist, NULL
is returned. Use treedb_get_node()
if only the primary key is needed.
Prototype
// Not applicable in JS
Prototype
# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples