跳到主要内容

FindPathsOptions<T, U, V>

Defined in: rxdb-plugin-graph/src/graph-repository.interface.ts:210

图路径查询选项(基础)

Type Parameters

Type ParameterDefault type
T extends EntityTypeEntityType
UGraphWhere<T>
V extends EdgeFilterOptionsEdgeFilterOptions

Properties

direction?

optional direction?: "in" | "out" | "both";

Defined in: rxdb-plugin-graph/src/graph-repository.interface.ts:232

查询方向

  • 'in': 入边路径
  • 'out': 出边路径
  • 'both': 双向路径(默认)

Default

'both'

edgeWhere?

optional edgeWhere?: V;

Defined in: rxdb-plugin-graph/src/graph-repository.interface.ts:264

边约束条件 应用于路径上的所有边

Example

// 只走高速公路
edgeWhere: `{ properties: { roadType: 'highway' } }`

// 避免拥堵路段(需要启用 weight)
edgeWhere: `{ weight: { max: 10 } }`

fromId

fromId: EntityStaticType<T, "idType">;

Defined in: rxdb-plugin-graph/src/graph-repository.interface.ts:218

源节点 ID


maxDepth?

optional maxDepth?: number;

Defined in: rxdb-plugin-graph/src/graph-repository.interface.ts:243

最大搜索深度(防止过度搜索)

Default

10

Maximum

100

Remarks

路径搜索的复杂度随深度指数增长 建议根据实际图的密度调整此值


toId

toId: EntityStaticType<T, "idType">;

Defined in: rxdb-plugin-graph/src/graph-repository.interface.ts:223

目标节点 ID


where?

optional where?: U;

Defined in: rxdb-plugin-graph/src/graph-repository.interface.ts:249

节点约束条件 应用于路径上的所有中间节点