FindPathsOptions<T, U, V>
Defined in: rxdb-plugin-graph/src/graph-repository.interface.ts:181
图路径查询选项(基础)
Type Parameters
| Type Parameter | Default type |
|---|---|
T extends EntityType | any |
U | RuleGroup<InstanceType<T>> |
V | EdgeFilterOptions |
Properties
direction?
optional direction: "in" | "out" | "both";
Defined in: rxdb-plugin-graph/src/graph-repository.interface.ts:199
查询方向
- 'in': 入边路径
- 'out': 出边路径
- 'both': 双向路径(默认)
Default
'both'
edgeWhere?
optional edgeWhere: V;
Defined in: rxdb-plugin-graph/src/graph-repository.interface.ts:231
边约束条件 应用于路径上的所有边
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:185
源节点 ID
maxDepth?
optional maxDepth: number;
Defined in: rxdb-plugin-graph/src/graph-repository.interface.ts:210
最大搜索深度(防止过度搜索)
Default
5
Maximum
10
Remarks
路径搜索的复杂度随深度指数增长 建议根据实际图的密度调整此值
toId
toId: EntityStaticType<T, "idType">;
Defined in: rxdb-plugin-graph/src/graph-repository.interface.ts:190
目标节点 ID
where?
optional where: U;
Defined in: rxdb-plugin-graph/src/graph-repository.interface.ts:216
节点约束条件 应用于路径上的所有中间节点