Search code examples
neo4jpy2neo

How do I clone a sub tree for a node, what would be the easiest and fastest way to do that?


Here is the code I am working on:

def NodeExists(type_name, relationship_name):

    query_string = "MATCH (a)-[:%s]->(c) WHERE a.name = {y} RETURN {parent:a.name,child:{name:collect(c.name)}}"%(relationship_name)
    return graph.run(query_string, {"y":type_name}).data()

I don't know how to add a copy of the resulting tree into a different tree under different node using py2neo


Solution

  • I confirmed this with the Neo4j team,

    There is no current way of cloning a subgraph