Update in and out predicates to use unique iterator.
This commit is contained in:
parent
f775756ad1
commit
35a96a3a81
2 changed files with 9 additions and 1 deletions
|
|
@ -145,7 +145,8 @@ func buildInOutPredicateIterator(obj *otto.Object, qs graph.QuadStore, base grap
|
|||
dir = quad.Object
|
||||
}
|
||||
lto := iterator.NewLinksTo(qs, base, dir)
|
||||
return iterator.NewHasA(qs, lto, quad.Predicate)
|
||||
hasa := iterator.NewHasA(qs, lto, quad.Predicate)
|
||||
return iterator.NewUnique(hasa)
|
||||
}
|
||||
|
||||
func buildIteratorTreeHelper(obj *otto.Object, qs graph.QuadStore, base graph.Iterator) graph.Iterator {
|
||||
|
|
|
|||
|
|
@ -251,6 +251,13 @@ var testQueries = []struct {
|
|||
expect: []string{"bob", "greg"},
|
||||
},
|
||||
{
|
||||
message: "list all bob's incoming predicates",
|
||||
query: `
|
||||
g.V("bob").InPredicates().All()
|
||||
`,
|
||||
expect: []string{"follows"},
|
||||
},
|
||||
{
|
||||
message: "list all in predicates",
|
||||
query: `
|
||||
g.V().InPredicates().All()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue