How to get result from Cypher Query in json using Neo4j C# Client

六月ゝ 毕业季﹏ 提交于 2019-12-11 05:04:10

问题


i am using Neo4j 2.0.3 DB and using C# client to access neodb. I could not find any way by which after querying db i can get results in the form of Json. Please give me some links or examples


回答1:


You can get Cypher Query results in JSON format

eg. Consider a graph with person nodes and nodes have property personId. The below query will give you result in the form of json object.

MATCH (n:PERSON)-[:friend]->(friend:PERSON) RETURN {personId: n.personId, friends: collect(distinct friend.personId)} as PersonData

Now you have the json string. Now using this or anyother way you can get it in an object



来源:https://stackoverflow.com/questions/24751399/how-to-get-result-from-cypher-query-in-json-using-neo4j-c-sharp-client

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!