apoc.hashing.fingerprintGraph

Function APOC Core

apoc.hashing.fingerprintGraph(propertyExcludes [String]) - calculates a MD5 checksum over the full graph. This function uses in-memory data structures. Unsuitable for cryptographic use-cases.

Signature

apoc.hashing.fingerprintGraph(propertyExcludes = [] :: LIST? OF STRING?) :: (STRING?)

Input parameters

Name Type Default

propertyExcludes

LIST? OF STRING?

[]

Usage Examples

The examples in this section are based on the following sample graph:

MERGE (joe:Person {name: "Joe"})
MERGE (ryan:Person {name: "Ryan"})
MERGE (ryan)-[:FOLLOWS {since: datetime("2020-11-04")}]->(joe);

This function computes a fingerprint of the whole graph using the MD5 checksum:

RETURN apoc.hashing.fingerprintGraph() AS output;
Table 1. Results
output

"655408F901B554A8999AEF61EA6D5AE5"

We can pass in a list of properties to exclude from the fingerprint, as shown in the following query:

RETURN apoc.hashing.fingerprintGraph(["since"]) AS output;
Table 2. Results
output

"0583812D25093B4CD03C96DF15215048"