Home > Software engineering >  ArangoDB: Syntax error Unexpected For declaration
ArangoDB: Syntax error Unexpected For declaration

Time:10-19

in the following query I want to traverse a graph and get a list of fraud nodes and then I want to get all the traversals between those fraud nodes in the graph.

Fraud nodes I want to store in the variable lstofnodes. How to solve this error?

let lstofnodes=(for doc in Account  
    filter doc.fraud == true
        for v in 1..3 outbound doc graph "G1"
            return distinct v._id)
            return lstofnodes
            for vertex in 1..3 outbound lstofndes  graph "G1"
                return distinct vertex._id

CodePudding user response:

Can you try (the first return seems wrong, but cannot verify without data)

let lstofnodes=(for doc in Account  
filter doc.fraud == true
    for v in 1..3 outbound doc graph "G1"
        return distinct v._id)
        FOR startnode IN lstofnodes
        for vertex in 1..3 outbound startnode  graph "G1"
            return distinct vertex._id
  • Related