Database Reference
In-Depth Information
Listing 7-8. Removing a Label from a Node
var _graphClient = new GraphClient(new Uri("http://localhost:7474/db/data"));
_graphClient.Cypher
.Match("(user:User)")
.Where<User>(user => user.userId == "10")
.Remove(" user :Developer")
.ExecuteWithoutResults();
Debugging
As part of developing Cypher queries, you will from time to time need to view the actual query that's being executed
for debugging purposes. To that end, each query can be set to a variable as well as access the QueryText and
QueryParameters output through the Query object, as shown in Listing 7-9.
Listing 7-9. Removing a Label from a Node
var query =_graphClient.Cypher
.Match("(user:User)")
.Where<User>(user => user.userId == "10")
.Remove(" user :Developer")
.ExecuteWithoutResults();
Developing a .NET Neo4j Application
Preliminary to building out your first .NET Neo4j application, this section covers the basics of configuring a
development environment.
Preparing the Graph
To spend more time highlighting code examples for each of the more common graph models, you will use a preloaded
instance of Neo4j including necessary plugins, such as the spatial plugin.
to quickly setup a server instance with the sample data and plugins for this chapter, go to graphstory.com/
practicalneo4j . You will be provided with your own free trial instance, a knowledge base, and email support from Graph
Story. alternatively, you may run a local Neo4j database instance with the sample data by going to graphstory.com/
practicalneo4j , downloading the zip file containing the sample database and plugins, and adding them to your local
instance.
Tip
Using the Sample Application
If you have already downloaded the sample application from graphstory.com/practicalneo4j for .NET and
configured it with your local application environment, you can skip ahead to the section “.NET Application
Configuration.” Otherwise, you will need to go back to the “.NET and Neo4j Development Environment” section in this
chapter and set up your local environment in order to follow along with examples in the sample application.
 
 
Search WWH ::




Custom Search