跳到主要内容

useGraphPaths()

function useGraphPaths<T>(EntityType, options): RxDBResource<GraphQueryResult<GraphPath<T>>>;

Defined in: rxdb-angular/src/hooks.ts:299

查找图结构中两个实体之间的路径

Type Parameters​

Type Parameter
T extends GraphEntityType

Parameters​

ParameterTypeDescription
EntityTypeT实体类
optionsUseOptions<EntityStaticType<T, "findPathsOptions">>路径查询参数(fromId、toId、最大深度等)

Returns​

RxDBResource<GraphQueryResult<GraphPath<T>>>

返回包含路径的资源 signal

Example​

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