Arangodb-Foxx遍历中filter和expandFilter的区别
Arangodb- Differences between filter and expandFilter in Foxx traversal
在遍历配置选项中,有两个设置似乎做同样的事情,即 filter 和 expandFilter。它们之间有什么区别吗?
虽然filter
用于限制使用遍历返回的顶点结果,expandFilter
可以从遍历中排除某些边。
- filter: vertex filter function. The function signature is function (config, vertex, path). It may return one of the following values:
- undefined: vertex will be included in the result and connected edges will be traversed
- "exclude": vertex will not be included in the result and connected edges will be traversed
- "prune": vertex will be included in the result but connected edges will not be traversed
- [ "prune", "exclude" ]: vertex will not be included in the result and connected edges will not be returned
- expandFilter: filter function applied on each edge/vertex combination determined by the expander. The function signature is function (config, vertex, edge, path). The function should return true if the edge/vertex combination should be processed, and false if it should be ignored.
这在 ArangoDB Manual 中有记载。
在遍历配置选项中,有两个设置似乎做同样的事情,即 filter 和 expandFilter。它们之间有什么区别吗?
虽然filter
用于限制使用遍历返回的顶点结果,expandFilter
可以从遍历中排除某些边。
- filter: vertex filter function. The function signature is function (config, vertex, path). It may return one of the following values:
- undefined: vertex will be included in the result and connected edges will be traversed
- "exclude": vertex will not be included in the result and connected edges will be traversed
- "prune": vertex will be included in the result but connected edges will not be traversed
- [ "prune", "exclude" ]: vertex will not be included in the result and connected edges will not be returned
- expandFilter: filter function applied on each edge/vertex combination determined by the expander. The function signature is function (config, vertex, edge, path). The function should return true if the edge/vertex combination should be processed, and false if it should be ignored.
这在 ArangoDB Manual 中有记载。