java - Cypher loop over results -
i have companies have logged in , created relations of debt other companies . want make query ask has created relations (get first nodes in relation)
i
executionengine engine = new executionengine(graphdb); executionresult result = engine.execute( "start n=node(*) match n-[r]->() return distinct n.name");
when
out.println("companies have entered data "+result.tostring());
i wanted, need display in right way servlet.
iterator<node> list_companies = result.columnas("n.name"); while(list_companies.hasnext()){ node compan = list_companies.next(); out.println(compan.getid()+" "+compan.getproperty("name")); }
and no results. nodes have properties name, tax number , email. not think right way parse
result.tostring()
by removing " | +---||"...
if returning n.name you'll have property returned , not node:
iterator<node> list_companies = result.columnas("n.name");
should be:
iterator<string> list_companies = result.columnas("n.name"); while(list_companies.hasnext()){ string compan = list_companies.next(); out.println(compan); }
if want id , name properties return distinct n , node iterator in example.
Comments
Post a Comment