I have a custom function defined like:
CALL apoc.custom.asFunction('fn', "MATCH ...
RETURN stuff", 'NODE', [['param1', 'STRING']], false, 'docstring')
It's supposed to return a matched node by some criteria. When I run CALL custom.fn("something"...
My target to match looks like the following:
(:A) -[:R]-> (:B {val: 1})-> [:R]-> (:B {val : 2} )-> [:R]-> (:B {val: 3})-> [:R]-> (:B {val : 4})-> [:R]->(:C)
and I can match it with
MATCH (:A)-[:R *]->(C)
but is there a way I can specify constraints...
The page on user defined procedures and the example therein show how you can use the core API to define user-defined functions.
Is it possible for me to invoke a cypher query within a user-define procedure, or am I limited to using just the core API ...
@andrew.bowman I was wondering what the neo4j team thinks about gremlin as a possible traversal API replacement.
I like gremlin since it's standard and has a lot of documentation and examples available, but it looks like the neo4j integration has wan...
In general, we wouldn't recommend using gremlin at all, preferring cypher for a lot of reasons related to ease of use and performance
@david.allen I just want to mention that Gremlin isn't just an alternative to Cypher, it's also an interface.
For ...
Yes, both... maybe a sample code-block? It's a bit of a chore unraveling how to do those things from Neo4j documentation.
Unfortunately my usecase is rather simplistic, so either I have user-defined functions where I'm not using cypher at all or on...
Yes, of course you can execute your query using tx.execute. Was that your question?
Or are you asking if I'm able to execute cypher, as well as do other things in my function?
I would like to leave a note that
@Context
public Transaction tx;
might be a better idea than using the db directly. This is because if the calling code starts a transaction, and then your user-defined function (i don't know if this is a problem...