Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
02-11-2022 11:35 AM
I'm working on a bitcoin graph where a part of a path is the following:
(address)-[i:input]->(transaction)
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.
Thanks
Andreas
Solved! Go to Solution.
02-11-2022 01:03 PM
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.
02-11-2022 01:03 PM
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.
09-25-2022 02:53 AM
@glilienfield thanks for the answer!
It was implemented as you advised with the array. The values of a single feature where collected from multiple edges and stored in an array. Then that array was stored in a new edge. 😃
All the sessions of the conference are now available online