Surjit Jana
Surjit Jana

Reputation: 53

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

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

Upvotes: 1

Views: 3060

Answers (1)

Sumeet Sharma
Sumeet Sharma

Reputation: 2583

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

Upvotes: 3

Related Questions