跳到主要内容

FindPathsOptions<T, U, V>

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

图路径查询选项(基础)

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:259

查询方向

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

Default​

'both'

edgeWhere?​

optional edgeWhere?: V;

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

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

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:245

源节点 ID


limit?​

optional limit?: number;

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

最多返回的路径数。

Default​

1000

Maximum​

10000


maxDepth?​

optional maxDepth?: number;

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

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

Default​

10

Maximum​

100

Remarks​

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


toId​

toId: EntityStaticType<T, "idType">;

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

目标节点 ID


where?​

optional where?: U;

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

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