Add edge type filtering to DJORNL queries#27
Merged
jayrbolton merged 2 commits intodevelopfrom Sep 2, 2020
Merged
Conversation
Collaborator
ialarmedalien
commented
Sep 2, 2020
- I updated the README.md docs to reflect this change.
- This is not a breaking API change OR
ialarmedalien
commented
Sep 2, 2020
| FOR v, e, p IN 0..@distance ANY n djornl_edge | ||
| OPTIONS {bfs: true, uniqueVertices: "global"} | ||
| RETURN DISTINCT node._id | ||
| FILTER length(@edge_types) == 0 || p.edges[*].edge_type ALL IN @edge_types |
Collaborator
Author
There was a problem hiding this comment.
If the edge_types filter is empty, treat it as if all edge types are allowed.
jayrbolton
reviewed
Sep 2, 2020
| $schema: "http://json-schema.org/draft-07/schema#" | ||
| name: edge_types_filter | ||
| title: Edge Types | ||
| description: Edge types to filter on |
jayrbolton
reviewed
Sep 2, 2020
jayrbolton
reviewed
Sep 2, 2020
| LET edges = ( | ||
| FOR edge IN djornl_edge | ||
| FILTER edge._from IN node_ids AND edge._to IN node_ids | ||
| AND (edge.edge_type IN @edge_types || length(@edge_types) == 0) |
Contributor
There was a problem hiding this comment.
same comment above about short circuiting
Collaborator
Author
There was a problem hiding this comment.
fixed globally
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.