* Return the number of edges/relationships in this path. * Mirrors Cypher's `length(path)`.
()
| 185 | * Mirrors Cypher's `length(path)`. |
| 186 | */ |
| 187 | public length(): number { |
| 188 | let edgeCount = 0; |
| 189 | for (const step of this) { |
| 190 | if (step.value instanceof Edge) { |
| 191 | edgeCount++; |
| 192 | } |
| 193 | } |
| 194 | return edgeCount; |
| 195 | } |
| 196 | |
| 197 | /** |
| 198 | * Sum a numeric property across all items in the path. |