neo4j-(11)-java代码操作

1. 原生的Neo4j Java API

Driver driver = GraphDatabase.driver( "bolt://localhost:7687", AuthTokens.basic( userName, passWord ) );
		Session session = driver.session();
		session.run( "CREATE (a:Person {name: 'Arthur001', title: 'King001'})");

		StatementResult result = session.run( "MATCH (a:Person) WHERE a.name = 'Arthur001' " +
						"RETURN a.name AS name, a.title AS title");
		while ( result.hasNext() )
		{
			Record record = result.next();
			System.out.println( record.get( "title" ).asString() + " " + record.get( "name" ).asString() );
		}
		session.close();
		driver.close();

文档: https://neo4j.com/docs/java-reference/3.5/

上一篇:Java Record 的一些思考 - 序列化相关


下一篇:[翻译] 预览 C# 10 的新东西