apoc.hashing.fingerprintGraph

Details

Syntax

apoc.hashing.fingerprintGraph([ propertyExcludes ])

Description

Calculates a MD5 checksum over the full graph. This function uses in-memory data structures. Unsuitable for cryptographic use-cases.

Arguments

Name

Type

Description

propertyExcludes

LIST<STRING>

Property keys to exclude from the hashing. The default is: [].

Returns

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;
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;
Results
output

"0583812D25093B4CD03C96DF15215048"