neo4j (参数)???:未访问任何“???”Pylance

daupos2t  于 2022-11-05  发布在  其他
关注(0)|答案(1)|浏览(182)

(参数)疾病:任何“疾病”都不能访问Pylance
(参数)药品:未获得任何“药物”
{code:Neo.客户端错误。语句。参数缺失} {消息:预期参数:疾病、药物}

def add_medicine(tx, disease, drug):
        tx.run("CREATE (m1:Medicine {disease: $disease}) "
            "CREATE (m2:Medicine {drug: $drug}) "
            "CREATE (m1)-[:TREAT]->(m2) "
            "RETURN m1, m2")

    with driver.session() as session:
        session.write_transaction(add_medicine,"Fever","Water")
nuypyhwy

nuypyhwy1#

tx.run(
   "CREATE (m1:Medicine {disease: $disease}) "
   "CREATE (m2:Medicine {drug: $drug}) "
   "CREATE (m1)-[:TREAT]->(m2) "
   "RETURN m1, m2",
   disease=disease, drug=drug)

相关问题