mehdi
mehdi

Reputation: 912

is it possible to add new function to cypher?

it would be appreciated to if anyone can answer that is there any way to add an LOOP function to cypher? i can find loops in graph by use of traversal. but i want to know is there anyway to pass obtained result to a customized user defined Cypher function?

Upvotes: 2

Views: 1113

Answers (3)

Antimony
Antimony

Reputation: 2240

It seems that you are asking two different questions.

About whether you can use loops in Cypher, yes you can, with FOREACH or UNWIND, depending on what you want to achieve. This is a good resource for when you don't quite know which is the right one for your case. It compares the two and tries them with different example queries.

As for whether you can write user defined function, as of Neo4j 3.0, you can. They are however written in Java. Look into this link for more details: https://neo4j.com/developer/procedures-functions/

Upvotes: 0

Stefan Armbruster
Stefan Armbruster

Reputation: 39925

Until UDFs are possible with Cypher, you might consider using unmanaged extensions.

Upvotes: 1

Eve Freeman
Eve Freeman

Reputation: 33165

Not yet. They're talking about UDFs (User Defined Functions) in an upcoming release of Neo4j, though. You might consider refining your use case and asking for it as a feature of Cypher itself in github issues, as well.

Upvotes: 2

Related Questions