Neo4jOperator

Use the Neo4jOperator to execute SQL commands in a Neo4j database.

Using the Operator

Use the neo4j_conn_id argument to connect to your Neo4j instance where the connection metadata is structured as follows:

Neo4j Airflow Connection Metadata

Parameter

Input

Host: string

Neo4j hostname

Schema: string

Database name

Login: string

Neo4j user

Password: string

Neo4j user password

Port: int

Neo4j port

tests/system/providers/neo4j/example_neo4j.py[source]


neo4j_task = Neo4jOperator(
    task_id="run_neo4j_query",
    neo4j_conn_id="neo4j_conn_id",
    sql='MATCH (tom {name: "Tom Hanks", date: "{{ds}}"}) RETURN tom',
    dag=dag,
)

Was this entry helpful?