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
Asked
Active
Viewed 2,929 times
1 Answers
3
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

Community
- 1
- 1

Sumeet Sharma
- 2,573
- 1
- 12
- 24
-
I have this code can you tell me how can i get json from this data dirctly without using json serializer using c#. client.Cypher.Match("(user:User)-[:WATCHES]->(programme:Programme)").Return((user, programme) => new { UserInfo = user.As
(), Programme = programme.As – Surjit Jana Jul 16 '14 at 05:12() }).Results; -
Why dont you try executing it as a whole cypher query instead of using Cypher.Match etc... You can form a cypher query and just run it and iterate through the result.. – Sumeet Sharma Jul 16 '14 at 07:35