O'Reilly logo

Learning Neo4j 3.x - Second Edition by Rik Van Bruggen, Jérôme Baton

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Functions and procedures

As I mentioned before, APOC contains functions and procedures; let's see how they differ. The keyword is complexity.

Functions are giving simpler services than procedures. Functions are designed to return a single value after a computation that only reads the database. Consequently, as you will have inferred, procedures can make changes to the database and return several results.

Procedures have to be CALL-ed. Functions can be referenced directly in a Cypher query (function is in bold).

CREATE (p:Person{GUID:apoc.create.UUID()})

We will see in a later chapter how to write our own functions and procedures.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required