Merge pull request #331 from barakmich/fix_or
query/gremlin: fix building Or iterator, add test
This commit is contained in:
commit
7a5e206539
2 changed files with 8 additions and 1 deletions
|
|
@ -128,7 +128,7 @@ func buildPathFromObject(obj *otto.Object) *path.Path {
|
|||
if subobj == nil {
|
||||
return nil
|
||||
}
|
||||
return p.And(buildPathFromObject(subobj))
|
||||
return p.Or(buildPathFromObject(subobj))
|
||||
case "Back":
|
||||
if len(stringArgs) != 1 {
|
||||
return nil
|
||||
|
|
|
|||
|
|
@ -186,6 +186,13 @@ var testQueries = []struct {
|
|||
`,
|
||||
expect: []string{"charlie"},
|
||||
},
|
||||
{
|
||||
message: "test Or()",
|
||||
query: `
|
||||
g.V("bob").Out("follows").Or(g.V().Has("status", "cool_person")).All()
|
||||
`,
|
||||
expect: []string{"fred", "bob", "greg", "dani"},
|
||||
},
|
||||
|
||||
// Gremlin Has tests.
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue