如何使用Neo4j C#Client从json中的Cypher Query获取结果 [英] How to get result from Cypher Query in json using Neo4j C# Client

查看:288
本文介绍了如何使用Neo4j C#Client从json中的Cypher Query获取结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Neo4j 2.0.3 DB并使用C#客户端访问neodb.我无法找到查询db后以Json形式获得结果的任何方式. 请给我一些链接或示例

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

推荐答案

您可以获得JSON格式的Cypher Query结果

You can get Cypher Query results in JSON format

例如考虑具有人员节点的图,并且节点具有属性personId.以下查询将以json对象的形式为您提供结果.

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

现在您有了json字符串.现在使用或任何其他方式可以在对象中获取它

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

这篇关于如何使用Neo4j C#Client从json中的Cypher Query获取结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆