i need to use neo4j for a particular project how to connect it
I have discovered Virtual Doctypes but currently help me in this…
class RouteSurvey(Document):
def after_save(self):
doc = frappe.get_doc(“Route Survey”, self.name)
neo4j(doc)
URI = “bolt://localhost:7687”
AUTH = (“neo4j”, “####”)
Initialize the driver once and reuse it
driver = GraphDatabase.driver(URI, auth=AUTH)
@frappe.whitelist()
def neo4j(doc):
with driver.session(database=“routesurvey”) as session:
result = session.run(
“CREATE (:ROUTESURVEYNAME {name: $name})”,
name=doc.name
)
summary = result.consume()
print(f"Created {summary.counters.nodes_created} nodes in {summary.result_available_after} ms.")
giving correct db name and pass will create node in neo4j