跳到主要内容

useGraphPaths()

function useGraphPaths<T>(EntityType, options): RxDBResource<any[]>;

Defined in: hooks.ts:358

Find paths between two entities in a graph

Type Parameters

Type Parameter
T extends EntityType

Parameters

ParameterTypeDescription
EntityTypeTThe entity class
optionsUseOptions<EntityStaticType<T, "findPathsOptions">>Path query options (fromId, toId, maxDepth, etc.)

Returns

RxDBResource<any[]>

A reactive resource object containing paths

Example

const { value: paths } = useGraphPaths(User, {
fromId: 'user-1',
toId: 'user-2',
maxDepth: 5
});