How can I store the result of COLLECT(x) as a property in a relationship?

I'm working on a bitcoin graph where a part of a path is the following:


Most of the times there are thousands of input relationships between an address and a transaction. I'm trying to aggregate the relationships, create a new one, store the result of the aggregation and delete the old relationships. However, I get the following error:

Neo4j only supports a subset of Cypher types for storage as singleton or array properties. Please refer to section cypher/syntax/values of the manual for more details.

This is the query I ran:

MATCH (a:address {addressID: "some_hash"})-[i:input]->(tx:transaction {hash:"some_hash"})
WITH a AS address, tx AS transaction, COLLECT(i) AS input_attr
MERGE (address)-[inc:incoming]->(transaction)
SET inc.input_attributes = input_attr
RETURN address, transaction, inc

How could I do that? The part of deleting the old relationships is missing.


The variable 'i' is bound to a relationship entity. As I understand it, Neo4j can only assign primitive types or arrays of same as a property.